I was building a website using a CMS, and the navbar had a pretty common hover effect: the menu items turned bold when you hovered over them.
Nothing fancy. Simple. Basic, I thought.
Here's a simplified version of how I built it:
<nav class = "navbar" > <a href = "#" class = "logo" > Navbar </a>
<div class = "nav-links" > <a href = "#" class = "nav-link" > Home </a> <a href = "#" class = "nav-link" > Products </a> <a href = "#" class = "nav-link" > Services </a> <a href = "#" class = "nav-link" > About </a> <a href = "#" class = "nav-link" > Contact </a> </div> </nav>
Enter fullscreen mode
Exit fullscreen mode
.navbar { display : flex ; align-items : center ; justify-content : space-between ; gap : 32px ; padding : 20px 24px ; background : white ; border : 1px solid #ddd ; border-radius : 8px ; }
.logo { font-size : 20px ; font-weight : 700 ; color : #222 ; text-decoration : none ; white-space : nowrap ; }
.nav-links { display : flex ; align-items : center ; gap : 24px ; }
.nav-link { color : #333…