The previous section begins with a discussion of the basics of CSS (cascading style sheet).
Tell you there are three kinds of selector. However, only the HTML selector are described.
In this section, we'll introduce you to three kinds of details.
HTML Selector
Class selector:
ID selector:
HTML Selector
HTML selector is HTML tags, such as P, Div, TD and so on.
You define them in CSS, and in the whole page, the nature of this tag is based on your
The definition to show the. The syntax for HTML selector is as follows
tag {Property:value}
For example, the color we want to call H1 is red.
h1 {color:red}
Here is also a feature of CSS, which can define several selector
In a rule.
H1, H2, TD {Color:red}
This definition allows all H1, H2, and TD colors to be red.
Class Selector
Class selector has two types, one called related class selector, which is associated with a
HTML tag is related. Its syntax is
Tag.classname {Property:value}
For example, we want to call some, not all, H2 colors are red.
this is h2
this is red h2
The following is the program code
this is h2
this is red h2
The second type is independent class selector. It can be applied by any HTML tag.
Its syntax is as follows
. classname {Property:value}
If we have the following definition
. blueone {Color:blue} This article links http://www.cxybl.com/html/wyzz/CSS/20120601/27373.html