I'm attempting to center a 5px x 5px circle under the links in a navigation bar to indicate the current page, but I'm uncertain about how to achieve this effect.
Here is the current outcome: Link to Image
This is what I aspire to accomplish: Link to Image
Below is the code snippet:
<ul id="nav-menu">
<li class="nav-menu-item">
<a href="ourwork.html">Our work</a>
</li>
<li class="nav-menu-item">
<a href="#whatwedo">What we do</a>
</li>
<li class="nav-menu-item">
<a href="#blog">Blog</a>
</li>
<li class="nav-menu-item">
<a href="#contact">Contact</a>
</li>
</ul>
nav {
height: 70px;
background: #fff;
display: flex;
align-items: center;
padding: 0 75px;
}
#nav-logo-link {
flex: 1;
}
#nav-logo {
height: 35px;
}
#nav-menu {
list-style: none;
padding: 0;
white-space: nowrap;
}
#nav-menu > li {
display: inline;
margin: 0 10px;
}
#nav-menu > li > a {
text-decoration: none;
color: #000;
}
My attempt involved using an <i>
element inside the <li>
and positioning it absolutely. Although I was able to adjust its vertical position correctly, when setting left: 0;
, it unexpectedly moved to the left side of the entire navigation bar. I also tried placing a <div>
within the <li>
, but that did not yield the desired results.
Any suggestions or solutions would be greatly appreciated!