Skip to content

Instantly share code, notes, and snippets.

@rochellelewis
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rochellelewis/5c33e1ca9e252c3efcf7 to your computer and use it in GitHub Desktop.
Save rochellelewis/5c33e1ca9e252c3efcf7 to your computer and use it in GitHub Desktop.
CSS Specificity & Inheritance Activity
<h1>This is a CSS Specificity Exercise</h1>
<header class="header-home">
<div id="navbar">
<ul class="navbar-nav">
<li><a href="#">Home</a></li>
<li><a href="#">About Me</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</header>
h1 {
font-family: sans-serif;
}
header a {
color: black;
font: 1.4em sans-serif;
text-decoration: none;
}
/* Calculate the Specificity of the CSS Selectors Below */
div#navbar ul.navbar-nav > li > a:hover {
color: green;
}
header.header-home .navbar-nav > li > a:hover {
color: red;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment