I am trying to find out how to format for an element that is different throughout my site. For example, the background for my list in my navigation bar is green. I am making a list down in the body for listing multiple items. It is automatically taking all of the formatting in my nav bar and putting it in my list like it should.
My question is how to make a ID or CLASS to take away the formatting used in my nav bar to make my own formatting for this list in my body. I tried looking up youtube videos and googling for this but all I could find was formatting for multiple selectors at the same time.
How do I override the CSS for my nav bar for the list in the body?
for my class I tried doing and then ul.amazon01 { background-color: none; and it does not work.
My nav bar HTML:
<div class="flex-container">
<div class="box1">
<ul id="nav01">
<li class="dropdown">
<a href="#" class="dropbtn"># Menu</a>
<div class="dropdown-content">
<a href="index.html"></a>
<a>#</a>
<a href="#</a>
<a href="#</a>
<a href="#</a>
<a href="#</a>
</div>
</li>
</ul>
</div>
</div>
ul {
list-style-type: none;
margin: 0;
padding: 0.25rem;
overflow: hidden;
font-size: 1rem;
background-color: green;
border: 3px solid darkgreen;
}
This is the I want to use in my body
<ul class="amazon01">
<li>#</li>
<li>#</li>
<li>#</li>
<li>#</li>
</ul>
CSS
ul.amazon01 {
background-color: none;
}