CAscadingSTyleSHeets) defines how to display HTML elements.
1. The classification syntax structure of the selector:
1.1 Id selector 1.1.1 selector format
# Id: # + Element id; id is case sensitive.
1.1.2 example
{:;:;}
1.2 Class selector 1.2.1 selector format
: The Name Of The. + Class. The Class name is case sensitive.
1.2.2 example
{:;}
1.3 element (TAG) name selector 1.3.1 selector format
Element name: The element name is case-insensitive.
1.3.2 example
{:;}
1.4 compound selector 1.4.1 selector format
,, # Id,. ClassNameSemicolon (,).
1.4.2 example
{:;}
1.5 level selector 1.5.1 selector format
Parent Selector: Meets the sub-Selector condition under the parent selector..
1.5.2 example
① The parent selector is an element.
{:}
② The parent selector can be a class, Id selector, or a child selector.
{:;}/* Indicates that when the table class is showInfo_tabel, the height attribute of the tr element below is 20px */
1.5.3 Image Display
2. Storage of CSS styles
Styles can be stored in 2.1 external style sheet 2.1.1 storage mode
It is stored in a special style table. A file suffixed with css.
2.1.2 Reference Method
Add the <link/> label to the
2.1.3 application scenarios
Multiple page sharing styles, such as the layout of Forum posts.
2.2 internal Sample Table 2.2.1 Storage Method
{:}
2.2.2 Use Cases
A style exclusive to a single page.
2.3 inline style 2.3.1 storage mode
Element.
2.3.2 application scenarios
Special elements for special occasions.
3. Style priority
UnionMethod.
IntersectionWhich style attribute will be used according to the following conditions:
3.1 extraordinary reference
.
3.1.1 priority comparison
>
Multiple style selectorsContains this element.
>.
Show image:
Series of articles =================================================== ====