Tag: Match is a space HTM attribute selector usage use col
CSS selectors are still relatively rich, the main CSS selector is as follows:
Tag Selector (for example: Body,div,p,ul,li)
. class selector (e.g.: class= "Head", class= "Head_logo")
ID Selector (for example: id= "name", id= "Name_txt")
Global selector (e.g., *)
. Combo selector (e.g.:. Head Head_logo, note two selector separated by SPACEBAR)
. Inherit selectors (e.g. Div p, note two selector separated by SPACEBAR)
Pseudo-class selectors such as: Link style, Pseudo-class of element A, 4 different states: link, visited, active, hover. )
String Matching Property selector (^ $ * three, respectively, corresponding to start, end, inclusive)
The above selectors are most commonly used in the daily development of tag selectors, class selectors, and ID selectors, following the basic usage of these three types of selectors:
1. Tag name Selector
There are many tags in an XHTML document, such as P tags, h1 tags, and so on. To make all P tags in a document use the same CSS style, you should use a tag Selector.
div {color:red;border:1px blue solid;} p {color: #000;}
2. Class Selector
You can use the tag selector to specify the same CSS style for the same tag in the entire XHTML document. In practice, however, the same tag in an XHTML document is reused. To assign a different CSS style to the same label, you should use the class selector.
<div class= "Test" > Test code </div>. Test {color:red;border:1px blue solid;}
3, ID selector, ID selector is unique, can only get a unique element.
<div id= "Test" > Test code </div> #test {color:red;border:1px blue solid;}
What are the CSS selectors