Introduction to CSS Content (cascading style sheets)

Source: Internet
Author: User

CSS is the color of the page editing, is the rendering of its function.

Each element has a display property according to the specification, and each element has a------------such as a DIV element whose default is block.

Inline and block-level elements

Block-level elements occupy a rectangular area that can be set to a higher length and width, whereas the elements in the row are not. Block-level elements can nest inline elements, whereas inline elements do not.

Referencing CSS

Working with external style sheets

Use code to reference CSS, code <link rel= "stylesheet" herf= "Main.css" >

It enables code separation, ease of maintenance and use.

Using an internal style sheet

Write CSS in the HTML document, write in the head tag, the code is as follows <style type= "Text/css" > </style> This is more convenient, but it is difficult to share multiple pages, not easy to modify, Therefore, it is not recommended to use this internal style sheet.

Using inline style Sheets

Written directly in the start tag, and the internal style sheet are similar, not very recommended to use.

Comments for CSS

CSS in a rule with the format: selector {declaration block}

Element Selector------------tag name {declaration block}

Class selector---------------. class name {declaration block} class name itself, you need to include the class attribute in the start tag of the HTML tag

ID selector----------------#id值 {declaration block}

Combo/Set Selector------tag name 1, tag name 2{declaration block} tag name not limited

Pseudo class selector--------------for the A label a:link not accessed a:visited accessed a:hover mouse hover a:active Click {Declaration block}

Descendant selector--------------to sign its ancestor table before the descendant label after {declaration block}

The subset selector--------------the parent element in the previous descendant label after {declaration block}

Property selector (Input type= "text")

Format one: element name [property name + attribute value]{declaration block}

Format two: element name [attribute name + "up greater than sign =" + attribute value]{declaration block} Select label starting with attribute value

Format three: element name [attribute name + "&=" + attribute value]{declaration block} Select a label that ends with a property value

Format four: element name [attribute name + "*=" + attribute value]{declaration block} Select the property value of the tab

Small content and other content will be written on the following ...

Introduction to CSS Content (cascading 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.