CSS Cascading Style Sheets

Source: Internet
Author: User

CSS Cascading Style Sheets.
Separate the styles from the Web page, completely controlled by CSS.
Enhances the repeatability and extensibility of styles.
Format:

Selector {Property Name: property value; property name; property Value ...}

Four ways to combine CSS and HTML code:
1, each HTML tag has a style property.
2, you can reuse a page when multiple labels have the same style.
<style>
CSS Code
</style>
3, when there are multiple pages in the same style of the label, you can also separate the style into a CSS file, by the definition of each page.
<style>
@import url ("1.css");
</style>
4. Connect a CSS file via the link tag in the head tag in HTML.
<link rel= "stylesheet" href= "1.css"/>

Tip: To improve the reusability and extensibility of the same style, you can define multiple label styles individually and encapsulate them as CSS files.
P.css, Div.css, input.css ...
Import multiple label style files into one CSS file using the import of CSS.
Then, on the HTML page, use the link tag to import the total CSS file.

1.css
@import url ("P.css");
@import url ("Div.css");
<link rel= "stylesheet" href= "1.css" >
------------------------------------------------------------
Selector: is actually the style to function the label container.
When the style is detached, HTML is used to encapsulate the data with tags and then load the CSS onto the specified label.
Basic categories of selectors:
1, Tag Selector: In fact, every sign in HTML is a signature.
2, class selector: is actually the class attribute in each tag, expressed in the form ".".
3,id selector: Actually is the id attribute in each tag, but to guarantee the ID uniqueness, use "#" to identify.
The ID can be used not only by CSS, but also by JavaScript.
Selector Priority: ID > Class > tag

Extended selector:
1, correlation selector: It is actually the label of the label in the style definition. Selector selector ...
2, Combo selector: Make the same style definition for multiple selectors. To pass multiple selectors in a "," delimited form
3, pseudo-element selector: is actually a state of the element.
A:link: The hyperlink is in the pre-order state.
a:visited: Hyperlink is post-state.
A:hover: Hover over the hyperlink.
A:active: When you click the hyperlink.
When defining these states, there is a sequence: L V H A
P:first-letter
P:first-line
: Focus: Unfortunately, IE6 does not support it, but Firfox supports it.

CSS filters: In fact, through some code to complete the rich style.
Web design mode: div + CSS.
div: Row-level area.
Span: block-level area.
P: Row-level area, cannot nest Div in P.

Copyright NOTICE: There is not the right place, but also hope that you guide, thanks!

CSS 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.