I want to implement the cleanest amount of CSS through proper use of inheritance. All links need to be a shade of white, so lets say #fff
HTML
<div class="header">
<div class="headerLogo">
<a href="/">BruxZir</a>
</div>
<div class="headerMenu">
<a href="#">≡</a> <!-- other HTML and JS left out -->
</div>
</div>
CSS
.header {
background-color: #333;
color: #fff;
height: 36px;
width: 100%;
line-height: 36px;
}
/* should be replaced with image */
.headerLogo {
display:inline;
font-size: 24px;
line-height: 36px;
padding-left: 6px;
}
.headerLogo a{
color:#fff;
text-decoration:none;
}
.headerMenu{
float:right;
font-size: 36px;
margin-right: 6px;
}
.headerMenu a {
/* needs the same rules for color, font-size, no text-decoration */
}
Here is my Codepen
I am thinking that since many of these rules will apply to the rest of the links in the header, I can set this up somehow for better inheritance. Also wondering if I would be better served using <span>
s instead of <div>
s for the logo and the menu?
div
's there is just fine. Why not.header a { color: #fff; }
? \$\endgroup\$