[Javaweb Basics] 028.CSS Introduction and basic syntax

Source: Internet
Author: User

CSS Overview
    • CSS refers to cascading style sheets (Cascading style sheets)
    • Style defines how HTML elements are displayed
    • Styles are typically stored in style sheets
    • Add a style to HTML 4.0 to solve the problem of separating content from performance
    • external style sheets can greatly improve productivity
    • External style sheets are typically stored in CSS files
    • Multiple style definitions can Cascade to a
Precedence of CSS
    • Browser default settings
    • External style sheet
    • Internal style sheet (inside the
    • Inline style (inside HTML elements)
basic syntax for CSS
    • Code structure

    • The wording of the color

p {color: #ff0000 ;}, p {color: #f00 ;} and P {color: rgb(100%,0%,0%) ;} Is the right thing to do.

    • Value is a number of words remember quotation marks

P {font-family: "sans serif" ;}

    • Each line describes only one property

p {
Text-align:center;
Color:black;
font-family:arial;
}

    • Spaces and case

Most style sheets contain more than one rule, and most rules contain more than one declaration. The use of multiple declarations and spaces makes it easier to edit a style sheet:

   Body {  color: #000;  Background: #fff;  margin:0;  padding:0;  Font-family:georgia, Palatino, serif;   }

The inclusion of spaces does not affect how the CSS works in the browser, and, unlike XHTML, the CSS is not sensitive to casing. However, there is one exception: class and ID names are sensitive to capitalization if they involve working with HTML documents.

  

This site article is for baby bus SD. Team Original, reproduced must be clearly noted: (the author's official website: Baby bus )

reprinted from "Baby bus Superdo team" original link: http://www.cnblogs.com/superdo/p/5023602.html

[Javaweb Basics] 028.CSS Introduction and basic syntax

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.