CSS describes the layout of a Web page

Source: Internet
Author: User

1.CSS format

CSS rules consist of two main parts: selectors, and one or more declarations; The CSS declaration always ends with a semicolon (;), and the declaration group is enclosed in curly braces ({}):

. Style{color:red;text-align:center;}

2.CSS Note:/**/

3.CSS Selector
The HTML element sets the ID selector with the id attribute, and the ID selector in the CSS is defined with "#"

#terminal {text-align:center;color:red;}

The class selector is represented in the HTML as a class attribute, and in CSS, the category selector takes a point "." Number Display

. center {Text-align:center;}

Specifies that a specific HTML element uses the class

p {text-align:center;}


4.CSS creation
There are three ways to insert a style sheet: inline style) inline style > (internal style) Internal style sheet > (external style) External style sheet > browser default style

External style sheet (External style sheet)

Internal style sheet (Internal style sheet)

100%float: left;width:63%; height:98%; margin-top:1%;margin-bottom:1%;margin-left:1%;margin-right:1%float: left;width:33%; height:98%; margin-top:1%;margin-bottom:1%;margin-left:1%;margin-right:1%;}. box {position:relative; background: #003; border-top:1px solid #d2d6de; border-top-color: # 383838;} </style>

Inline styles (inline style)

<div id= "full" class= "BigBox" style= "height:1000px;" >

CSS describes the layout of a Web page

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.