Multiple Styles: If external styles, internal styles and inline styles are applied to the same element at the same time, it is the case of multiple styles.
There is an exception, that is, if the external style is placed after the internal style, the external style will override the internal style.
Examples are as follows:
##
##
< ;!-- Settings: h3{color:blue;} -->
Test!
##
#Select Priority of the browser
Explanation:
1. The maximum weight of the inline style sheet is 1000 ;
2. The weight of the ID selector is 100
3. The weight of the Class selector is 10
4. The weight of the HTML tag selector is 1
Use the weight of the selector for calculation and comparison. The example is as follows:
##
##
#redP p {
/ Red */
##/*Rights value = 100+10+1 = 111*/
# COLOR:#00F;/*Blue*/
##
/*Power value = 100+1+1+1 = 103*/
#::#ff0
## class="red">red
## #
Result: The data in the tag is displayed in blue.
CSS priority rule:
A Each selector has a weight, the greater the weight, the priority;
B When the weights are equal , the style sheet settings that appear later are better than the style sheet settings that appear first;
C The creator’s rules are higher than those of the browser: that is, the CSS style set by the web page writer has a higher priority than that set by the browser The style of