CSS style sheet------Chapter One: Basic concepts of style sheets

Source: Internet
Author: User

CSS (cascading style Sheets, cascading style sheets), control the appearance of the page style, the role is to beautify the HTML page.

First, the basic concept of style sheets

1. Classification of Style sheets

(1) Inline style sheet -----placed in the opening tag of the element, only the current element, and the HTML joint display, the control is accurate, but the reusability is poor, more redundant.

Cases:

<input name= "txt" style= "border:0px; border-bottom:1px solid black; "type=" text "/>

Cases:

Show Results:

(2) Inline style sheet -----As a separate area, embedded in the Web page, can work on the entire page, must be written in between

Cases:

 <meta http-equiv= "Content-type" content= "text/html; charset=utf-8"/><title> Untitled document </title>  <style type= "Text/css" >input{border:5px;                         <style is an inline style sheet between color: #3F6; border-bottom:3px solid Red;} </style><body><input type= "text" name= "A1" id= "A1" ><input type = "Buttom" name= "A2" id= "A2" value= "button" ><p> Hello </p>               <!--input other than unchanged, no effect---< /body>

Show Results:

(3) The external style sheet -----placed in a separate. CSS style sheet file, you can work on the entire Web site.

mode of operation: create a new one. CSS file, which is used to store the style sheet and call the style sheet in HTML, to right-click in the HTML-->css style sheet and attach the style sheet. Style sheets are generally connected by link.

1, the definition of the external style sheet.

Cases:

" Utf-8 " ; /*  */input{border:5px;                       Color: #3F6; border-bottom:3px solid red;}

2. Calls to external style sheets.

Cases:

"Content-type"Content="text/html; Charset=utf-8"/><title> Untitled Document </title><link href="file:///E|/page/untitled-2.css"Rel="stylesheet"Type="Text/css"/><!--link-connected external style sheet-"text"Name="A1"Id="A1"><input type="Buttom"Name="A2"Id="A2"Value="Button"><p> Hello </p> </body>


Show Results:

CSS style sheet------Chapter One: Basic concepts of style sheets

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.