Cascading Style Sheets: CSS cascading style Sheet. V2.1
Controls the appearance of page styles.
One, the style sheet is divided into three categories:
1. Inline style sheet. --placed in the start tag of the element. --only works on the current element.
<input name= "txt" style= "border:0px; border-bottom:1px solid black; "type=" text "/>
2. Inline style sheet. --placed in the ...
<style type= "Text/css" >
Input
{
border:0px;
border-bottom:1px solid red;
}
</style>
3. external style sheet. --Put it in a separate. CSS style sheet file. --can be on the entire site.
(1) Definition of an external style sheet
(2) Invocation of an external style sheet
Second, the style sheet selector:
General syntax for inline, external style sheets:
Selector Selector
{
style = value;
style = value;
style = value;
....
}
1. Basic:
(1) Tag selector: Use tag name to select the selector.
Input{...}
Div{...}
Span{...}
Td{...}
(2) Category selector: Use class to categorize elements in HTML elements, and then use the value of this class as the selector.
The name of the. Class {...}
(3) ID Selector: Works on the element for the corresponding ID in HTLM.
#ID的名 {...}
#d1 {font-size:48px;}
#dd {border:5px dotted red;}
2. Compounding:
(1) separated by commas. --side-by-side relations, while working.
Input, #dd,. Yellow,.uu
{
Color:gray;
line-height:28px;
}
(2) separated by a space. --Future relationships.
Div UU
{
Background-color:blue;
}
<input name= "txt" type= "text" class= "UU"/>
<div>
<input name= "txt" type= "text"/>
<input name= "txt" type= "text" class= "UU" value= "******"/>
<span>
<input name= "txt" type= "text" class= "UU" value= "******"/>
</span>
</div>
What is a descendant???
(3) Class two filter.
Tag Selector. class Selector {...}
Input.uu
{
border:5px double red;
}
Cases:
Contrast: Div. UU is different from Div.uu.
Example 1: Inline style Sheets
:
Example 2: External style sheet
Example 3: Selectors
Example 3 Composite Selector
Use of HTML style sheets