I'm new to working with HTML and CSS, and I'm struggling to adjust the padding and margin of my navigation bar on a second page without it impacting the main index page.
Note: I want to give the nav bar a slightly different style on the second page.
There are 2 navigation bars, .navbar
and .navbar2
, each with the same code.
<div class="navbar">
<nav class="large clearfix">
<ul>
<li>
<a href="index.html">Home</a>
</li>
<li>
<a href="famous.html">Famous People</a>
</li>
<li>
<a href="places.html">Places to Visit</a>
</li>
<li>
<a href="contactus.html">Contact Us</a>
</li>
</ul>
<div class="veggieburger"><a href="#nav">≡</a></div>
</nav>
</div>
How can I target and style the navbar2
UL LI properties in the CSS so that they're different from the ones on the index page?
I've attempted this unsuccessfully in the CSS:
.navbar2 > li {
margin-top: 50px;
}