Is there a way to align my navbar to the right side while keeping the display: inline;
property intact? When I remove the display: inline;
property, the li
elements automatically align to the right side of the page, but in a list format.
HTML
<div id="header">
<div id="headerContainer">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Products</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</div>
</div>
CSS
#headerContainer ul {
list-style-type: none;
}
#headerContainer li {
display: inline;
padding-left: 10px;
text-align: right;
}
#headerContainer a {
text-decoration: none;
color: white;
}
#headerContainer a:hover {
color: black;
}
I'm trying to find a solution that allows me to keep the display: inline;
attribute while aligning my list items to the right side. Any help would be appreciated as I'm still learning. Thanks!