03. Style Characteristics
November 11, 2023Less than 1 minute
Cascading
According to the selector priority to select the final style to visualize elements, for resolving style conflict.
Inherient
Definition: The style for one element, will be used on the descendants of the element.
<style>
p {
color: red;
}
</style>
<p>
I'm a p element
<span> I'm a span element inside p</span>
</p>
Warning
Not all the style will be inherited, such as background related, layout, etc.
Style Priority
!important > inline style > ID selector > class selector > element selector > * > inherient style