In css, what's the difference of two selector: * and html?
*{
}
and
html{
}
Do these two work differently?
In css, what's the difference of two selector: * and html?
*{
}
and
html{
}
Do these two work differently?
the *{}
selects all elements and all it's children elements where html{}
only selects the <html>
element
See example
html {
border: solid 2px orange;
}
* {
border: solid 2px green;
font-size: 1.2em;
}
<ul>
<li>one</li>
<li>two</li>
<li>three
<ul>
<li>one</li>
<li>two</li>
<li>three</li>
</ul>
</li>
</ul>
<p>lorem ipsum</p>
Now see even how the font gets bigger cause its em
which will take the size from the previous element.