Web page CSS style sheet section

Source: Internet
Author: User

Cascading Style Sheets: CSS cascading style Sheet. V2.1 (3.0 versions Some older systems are not supported)

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 "/> (solid means solid line)

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

Create a new CSS file to put the style sheet, if you want to call the style sheet in the HTML file, you need to right-click in the HTML file--css style-Attach the style sheet. General Link Connection method

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. The 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. With "." Start. Class Name {...}

(3) ID Selector: Works on the element for the corresponding ID in HTLM. Start with "#" #ID的名 {...} #d1 {font-size:48px;} #dd {border:5px dotted red;}

2. Compound: (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 {}

<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" C lass= "UU" value= "******"/> </span> </div> What is a descendant??? Descendants, the offspring, are descendants, and the subset value contains the next generation note that the:<p> does not have a div.

(3) Class two filter. Tag Selector. class Selector {...} input.uu {border:5px double red;}

Cases:

Contrast: Div. UU is different from Div.uu.

There are spaces in the middle of the representation of descendants, no space is the meaning of the filter.

Web page CSS style sheet section

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.