Home > Web Front-end > HTML Tutorial > Selector priority-:link pseudo-class_html/css_WEB-ITnose

Selector priority-:link pseudo-class_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:41:27
Original
1101 people have browsed it

Question: Please indicate the font color in the A tag in the following structure.

 

 Here is the text content

 

< ;/div>

Correct answer: blue

In fact, the verification method is very simple, you can know it after running it.

.alink a and a:link actually have the same priority. Whichever one is defined later will display the color of the one;

Determine the priority of the selector Levels can be thought of in terms of group fights: whoever has more people is stronger; there are the same number of people, and the one who comes after you will get the upper hand; even a small one is not as good as a big boss.

In other words, first count the number of selectors. Whichever style has more selectors will have a higher priority; if everyone has the same number of selectors, then the definition will take effect; if there are only There are many tag selectors, but they are not as good as a class or id selector.

Related labels:
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