There are four ways of using CSS are inline style, the page embedded (internal style sheet), an external file (an external style sheet), introducing external styles.
1. the line style (inline styles)
<tag style = "attribute name 1: 1 attribute value; property name 2: attribute value 2; ..."> </ tab>
2. embedded in the page (internal style sheet)
in the head tag which add a child tag
<style>
selector {
attribute name 1: 1 attribute value;
property name 2: attribute value 2;
......
}
</ style>
3. external files (external style sheet)
in the head tag which add a child tag
<link rel = "stylesheet" href = " file path css">
4. external introducing pattern
mainly in style initialization. Because there are some labels have their own style, we need to be emptied to facilitate their computing
css syntax: (Symbols are in English)
selector {
property name 1: attribute value 1;
attribute name 2: attribute value 2;
..... .
}
There are many options css respectively following seven rules and usage
ID selector
using the selector id: id add an attribute in the elements above, the id attribute value of the attribute not start with a number of
a page can only have an id attribute value
css the method of representation chosen is represented by id #
class selector
using the class selectors: a class attribute increased on an element, the class attribute value of the attribute not start with a number of
a page can have multiple class attribute value
the css class selector representation by Indicates
tag selector
to write directly to the tab name
combination selector
selector directly, can be separated
progeny selector
> only for progeny
descendant selectors
with spaces, he said progeny contains the selectors
universal selector
* for all labels