Selector son
A son selector targets an immediate child of an element. The child selector consists of one or more single selectors separated by a higher sign ">". The parent element is to the left of the ">" sign, and it is allowed to leave blank space between the combination element and the selectors.
The following rule applies to all elements strong
children of a div member:
div > strong { color:#f00; }
Only Strong elements that are direct descendants of the element div
shall be affected by this rule. If there is any other element between the div
and the element strong
in the document tree, the selector will not apply. In the following example, only "Text one" will be affected by the rule:
<div>
<strong>Texto um</strong>
<p><strong>Texto dois</strong></p>
</div>
See More about Selectors
So your code should look like this:
.AlterarCSS > ul > li > span{
background: yellow;
}
<div class="AlterarCSS">
<ul>
<li>Nome - <span>Endereço Site<span></li>
<li>Nome - <span>Endereço Site<span></li>
<li>Nome - <span>Endereço Site<span></li>
</ul>
</div>
in the div that contains the
ul
– Gislef