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
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;
}
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