task goal: use one of the special values in the Controlling inheritance section to write a declaration in a new rule that will reset the background color back to white
my work:
HTML part
The Cascade Task
<body>
<div id="outer" class="container">
<div id="inner" class="container">
<ul>
<li class="nav">
<a href="#">One</a>
</li>
<li class="nav">
<a href="#">Two</a>
</li>
</ul>
</div>
</div>
</body>
CSS part:
body {
background-color: #fff;
color: #333;
font: 1.2em / 1.5 Helvetica Neue, Helvetica, Arial, sans-serif;
padding: 1em;
margin: 0;
}
#outer div ul .nav a {
background-color: blue;
padding: 5px;
display: inline-block;
margin-bottom: 10px;
}
#outer #inner {
background-color: initial !important;
}
div div li a {
color: yellow;
}
</style>
all I have done is to add one rule
#outer #inner {
background-color: initial !important;
}
my thinking:
- I use the initial because the natural value of background-color is white
- I have 2 ID selector and I !important, in every perspective, my specificity score will make my rule override all the others
However, it just doesn’t work out. So I want to know why