CSS style, css

Source: Internet
Author: User

CSS style, css
Css style sheet:
1. Classification of style sheets:
<1>. Use inline style: Example template: (set style for Section p)
<P style = "color: Red; font-size: 25pt;">
Paragraph text (p)
</P>
Features: (only valid for the labeled P tag)
<2>. Internal style: add the style to the
<Style type = "text/css">
H1 {color: Bule; font-size: 20pt ;}
</Style>
Feature: it is valid for all h1 labels on a page, but only for one page
Cannot be valid for another html
<3>. External style sheet: (this effectively improves code reusability for all imported pages)
Import required: <link type = "text/css" rel = "stylesheet"


Href = "external style table path"/>
2. style sheet priority:
The Inline style has the highest priority.
Internal style, external style to see who is at the front and who is at the front has a higher priority


3. Selector
3.1 selector category:
3.1.1 tag Selector
<Style type = "text/css">
Label, span, and so on {
Define Style
}
P span {
Define a style (span label under the p label
Apply the style defined by the p label before using
Span tag
A B c {
(C under B under)
}


</Style>
3.1.2 class selector
. {
Define Style
}
(Usage:
<Div class = "a">
Content
</Div>
)
3.1.3 ID Selector
# Aa {
Define Style
}
(Usage:
<Div id = "a">
Content
</Div>
)
3.1.4 pseudo-class selector
A: link {

}
A: hover {

}
A: visited {

}
Complex selector:
Usage 1:
Selector 1 selector 2 {

}

# {
(# A selector under a selector)
}
Usage 2:
Selector 1, selector 2 {
}

# A, {

Parallel

}

4. Common style attributes
4.1 table layout is generally not used (with minor changes) <table> </table>

Common layer layout <div> border = "" </div>

Box Model

Firefox browser debugging with view-firebug
 

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.