CSS Quick Start, css Quick Start

Source: Internet
Author: User

CSS Quick Start, css Quick Start

I. Overview
Cascading Style Sheets; Control HTML elements to improve the Display Effect and position of HTML elements;

Ii. Basic syntax
Css rules are composed of two parts: Selector and statement.
Statement rules:
1.css selector names are case sensitive; Attribute names and attribute values are case sensitive;
2. The end of each statement must be used; the last line can be omitted;
3. Comment format :/**/
4.css codes written in html must be wrapped with style labels;
5. If you write a css file separately, you do not need to use the style label. All statements must be enclosed in braces;
6. If the attribute value contains spaces, double quotation marks must be used to enclose them;
7. If an attribute name corresponds to multiple attribute values, multiple attribute values are separated by spaces;
8.css file suffix. CSS;

Iii. format:
Selector {
Attribute name: attribute value;
Attribute name: attribute value;
Attribute name: attribute value;
...........
}

4. Selector
1. ID Selector
# Id attribute value {
Attribute name: attribute value;
Attribute name: attribute value;
.....
}

2. class selector
Attribute Value of the. class Attribute {
Attribute name: attribute value;
Attribute name: attribute value;
.....
}

3. Element selector (TAG selector)
Tag name {
Attribute name: attribute value;
Attribute name: attribute value;
.....
}

4. Attribute Selector
Tag name [property name = property value] {
Attribute name: attribute value;
....
}

5. Include Selector
Basic selector tag name {
Attribute name: attribute value;
....
}

Iv. Integration with html
1. Use the link tag in the html head tag
<Link rel = "stylesheet" type = "text/css" href = "css/regist-css.css">

2. Use the style label in the head label of the html page. You can also write css code in the style label. It can only be used in the html file, and other html files cannot be used;

3. In the label at the beginning, write the attribute name style = "attribute name = property value ;";

Related Article

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.