Home > Web Front-end > HTML Tutorial > CSS Selector Targeted Issues Asking Experts for Answers_html/css_WEB-ITnose

CSS Selector Targeted Issues Asking Experts for Answers_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:11:03
Original
815 people have browsed it

has the following rules
h1,h2 {
color:red;
}
h2 {
color:blue;
}
The final h2 font color is blue , isn’t the former more targeted? (0.0.0.2 > 0.0.0.1)


Reply to discussion (solution)

In your case, the two h2 are parallel, but What is written at the end has greater weight than what is written at the front.

The author's weight is not calculated this way. Group selectors are convenient for setting multiple common styles



Please refer to the following
Weight and priority rules of CSS selectors
http://www.nowamagic.net/csszone/css_SeletorPriorityRules.php


CSS Grouping
http://www.w3school.com.cn/css/css_selector_grouping.asp


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template