Here is the code for my navigation bar:
index.html
<header id="header" class="flex">
<h2 id="site-name"><a href="#">RandomSite</a></h2>
<!-- NAVIGATION -->
<nav id="header-nav">
<h3 class="hidden">RandomSite's hidden navigation</h3>
<ul class="nav-list">
<li><a href="#">Home</a></li>
<li><a href="#">News</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>
styles.css
/* NAVIGATION */
header {
border: 2px dashed black;
display: flex;
padding: 10px;
}
header h2 {
font-size: 18px;
font-weight: 700;
margin: 16px 0px;
}
.nav-list {
list-style-type: none;
display: flex;
float: right;
}
li {
list-style: none;
display: inline;
padding: 0px 5px 0px 0px;
}
This is how my navigation bar appears. I would like the content of the unordered list to be aligned to the right. Can anyone advise me on how to achieve this? See screenshot of navigation bar