当前位置:网站首页>Common selectors are

Common selectors are

2022-07-07 23:58:00 Xiao Zhang, run quickly.

Common selectors are :

        1、 tag chooser ;2、 Class selectors ;3、ID Selectors ;4、 Global selector ;5、 Combination selector ;6、 Inheritance selector ;7、 Pseudo class selector .

The first is tag chooser , It also becomes an element selector . The basic form of tag selector is as follows :tagName{property:value}, among tagName It's the label name ,property yes css Properties of .

The second is Class selectors , Class selectors are used to define the same rendering for a series of tags , The common grammar is .classValue{property:value}. among classValue Is the name of the class selector , This is from css The author names himself .

The third is ID Selectors ,ID A selector defines a particular html Elements , Only one tag or element in a web page uses a ID The attribute value .ID The basic syntax format of the selector is as follows :

#idValue{property:value}. among idValue yes ID The name of the selector , Can be CSS The writer writes it himself .

The fourth is Global selector , The global selector is for all htmlz Elements work . The grammar format is : *{propery:value}. among “*” Indicates that it works on all elements ,property Express css Properties of ,value Represents the property value .

The fifth is Combination selector , Is to match multiple selectors , It can form a compound selector , Also known as composite selector .

The sixth is Inheritance selector , The rule of inheritance is that child tags are undefined , The selector inheriting the parent tag ; When the child tag repeatedly defines the declaration of the parent tag , Execute the sub tag selector .

Seventh hour Pseudo class selector , Pseudo class selectors are mainly used in <a> On the label , It consists of four states : No access to the link (link)、 Visited link (visited)、 Activate Links (active)、 Mouse over the connection (hover).

原网站

版权声明
本文为[Xiao Zhang, run quickly.]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130553106454.html