I was wondering, in the exercise Mosh uses multiple times the “nav” in his CSS, I was wondering why that is? Because whenever I delete the that attribute in my CSS it doesn’t seem to change anything. My CSS was a little bit different, but still same result, it is on the bottom.
Mosh HTML:
<body>
<nav>
<ul>
<li><a href="">About</a></li>
<li><a href="">Courses</a></li>
<li><a href="">Forum</a></li>
<li><a href="">Learning Paths</a></li>
<li><a href="">Contact</a></li>
</ul>
</nav>
</body>
Mosh CSS:
html {
font-size: 62.5%;
}
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 1.6rem;
}
nav {
background: #000;
padding: .7rem
}
nav ul {
display: flex;
flex-direction: column;
list-style: none;
padding-left: 0;
text-align: center;
}
nav li {
margin: .5rem 0;
}
nav a {
color: #ccc;
text-decoration: none;
}
nav a:hover {
color: #fff;
}
My CSS
html {
font-size: 62.5%;
}
body {
margin: 10px;
font-size: 1.6rem;
font-family: Arial, Helvetica, sans-serif;
}
nav {
background-color: black;
padding: 0.7rem;
}
ul {
display: flex;
flex-direction: column;
list-style: none;
padding-left: 0;
align-items: center;
}
li {
margin: 0.5rem 0;
}
a {
color: white;
text-decoration: none;
}
a:visited {
color: white;
}
a:hover {
color: gray;
}