CSS (refer to my training)

Source: Internet
Author: User

1. What is CSS
1. CSS stands for Cascading Style Sheets
2. styles define how to display HTML elements
3. Style Sheets can save a lot of work
Ii. cascading order
What style will be used when there is more than one style specified for an HTML element?
1. browser default
2. External style sheet
3. Internal style sheet (inside the 4. inline style (inside an HTML element)
Number four has the higheset priority
Iii. CSS syntax
The CSS syntax is made up of three parts: a selector, a property and a value:
Selector {property: Value}
Body {color: Black}
P {font-family: "sans serif "}
P {
Text-align: center;
Color: black;
Font-family: Arial
}

. Center {text-align: Center}
<H1 class = "center"> this heading will be center-aligned <P class = "center"> This paragraph will also be center-aligned. </P>

You can also define styles for HTML elements with the ID selector. the ID selector is defined as #. the style rule below will match the element that has an ID attribute with a value of "green ":
# Green {color: Green}
The style rule below will match the P element that has an ID with a value of "para1 ":
P # para1 {text-align: center; color: Red}

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.