CSS is short for Cascading Style Sheet. It is a simple mechanism for adding styles to web documents and belongs to the layout language of the presentation layer.
1. Basic syntax Specification
Analyze a typical CSS statement:
P {COLOR: # FF0000; BACKGROUND: # FFFFFF}
"P" is called "selector", indicating that we want to define a style for "p;
Style declaration is written in a pair of braces;
COLOR and BACKGROUND are called "properties". Different properties are separated by semicolons;
"# FF0000"
color value can be written in RGB format, for example, color: RGB (, 0, 0) or hexadecimal format, just like color: # ff0000 in the preceding example. If the hexadecimal value is repeated in pairs, the effect is the same. For example, # ff0000 can be written as # f00. However, it cannot be abbreviated if it is not repeated. For example, # fc1a1b must be filled with six characters.(2) define the fontThe following font definition method is recommended for web standards:Body {font-family: "
) color valueThe color value can be written in RGB format, for example, color: rgb (, 0, 0) or hexadecimal format, just like color: # FF0000 in the preceding example. If the hexadecimal value is repeated in pairs, the effect is the same. For example, # FF0000 can be written as # F00. However, it cannot be abbreviated if it is not repeated. For example, # FC1A1B must be filled with six characters.(2) define the fontThe following font definition method is recommended for web standards:Body {font-f
CSS is an abbreviation for cascading style Sheets (cascading style sheets). is a simple mechanism for adding styles to a Web document, which belongs to the presentation layer's layout language.
1. Basic Grammar Specification
To parse a typical CSS statement:
P {COLOR: #FF0000; BACKGROUND: #FFFFFF}
Where "P" we call the "selector" (selectors), indicating that we want to define the "P" style;
The style declaration is written in a pair of curly braces "{}";
Color and background are called "Properti
The following font definition method is recommended for web standards:
Body {font-family: "lucida Grande", verdana, lucida, Arial, Helvetica,, sans-serif ;}
* The font is selected in the listed order. If your computer contains the lucida Grande font, the document will be specified as lucida grande. If not, it is sp
)And can also be written in hexadecimal format, as in the above example.Color: # ff0000. If the hexadecimal value is repeated in pairs, the effect is the same. For example, # ff0000 can be written as # f00. However, it cannot be abbreviated if it is not repeated. For example, # fc1a1b must be filled with six characters. 3. Define the font
The following font definition method is recommended for web standards:
Body {font-family: "lucida Grande", verd
Note:
1, except the choice DOCTYPE statement must use the lowercase English letter writing. These include mouse actions generated by Macromedia Dreamweaver, such as OnMouseOver, which must also be modified to OnMouseOver.
2. XHTML regulations require that all logos must have a beginning and an end. For example, 3. All XML tags must be properly nested. If:
4. All attributes must be enclosed in quotation marks "". such as:
5, all
6. Assign a value to all attributes.such as:
7, do not use "--"
CSS is the abbreviation for cascading style Sheets (cascading style sheets). is a simple mechanism for adding styles to Web documents, belonging to the layout language of the presentation layer.
1. Basic Grammatical specifications
Parse a typical CSS statement:
P {COLOR: #FF0000; BACKGROUND: #FFFFFF}
Where "P" we call "selector" (selectors), indicates that we want to define a style for "P";
The style declaration is written in a pair of curly braces "{}";
Color and background are called "Properti
Web standards recommend the following font definition methods:
Body {font-family: "Lucida Grande", Verdana, Lucida, Arial, Helvetica, XXFarEastFont-Franklin, Sans-serif;
* Fonts are selected in the order listed. If the user's computer contains Lucida Grande fonts, the document is specified as Lucida Grande. If
with six characters.3. Define the fontThe following font definition method is recommended for web standards:Body {font-family: "Lucida Grande", Verdana, Lucida, Arial, Helvetica,, sans-serif ;}The font is selected in the listed order. If your computer contains the Lucida Grande font, the document will be specified as Lucida
, the same effect. For example: #FF0000可以写成 #f00. However, if you do not repeat it, for example, #fc1a1b must be written six bits.
3. Defining fonts
The Web Standard recommends the following font definition methods:
Body {font-family: "Lucida Grande", Verdana, Lucida, Arial, Helvetica, song Body, Sans-serif;}
Fonts are selected in the order listed. If the user's computer contains
application of the site.
CSS is not the difference between the space and the case, the following are some basic induction
(1) Color value
The color values can be written in RGB values, for example: Color:rgb (255,0,0), or in hexadecimal, as in the example color above: #FF0000. If the hexadecimal value is a pair of duplicates can be abbreviated, the same effect. For example: #FF0000可以写成 #f00. However, if you do not repeat it, for example, #fc1a1b must be written six bits.
(2) Defining fonts
The
The Web Standard recommends the following font definition methods:
Body {font-family: "Lucida Grande", Verdana, Lucida, Arial, Helvetica, song Body, Sans-serif;}
* Fonts are selected in the order listed. If the user's computer contains Lucida Grande fonts, the document will be designated as Lucida Grande. If not, i
web standards:Body {font-family: "Lucida Grande", Verdana, Lucida, Arial, Helvetica,, sans-serif ;}The font is selected in the listed order. If your computer contains the Lucida Grande font, the document will be specified as Lucida Grande. If no, It is specified as the Verdana font. If no Verdana is available, it is s
repeated. For example, # fc1a1b must be filled with six characters.
3. Define the font
The following font definition method is recommended for web standards:
Body {font-family: "lucida Grande", verdana, lucida, Arial, Helvetica,, sans-serif ;}
The font is selected in the listed order. If your computer contains the lucida Grande font, the document will be specifi
Note:
1. The statements except doctype must be written in lowercase English letters. This includes mouse actions generated by Macromedia Dreamweaver. For example, onmouseover must also be changed to onmouseover.
2. XHTML laws require that all identifiers must start and end. Such as CodeThe connected browser is not recognized.
3. All XML tags must be reasonably nested. For example,
4. All attributes must be enclosed by quotation marks. For example,
5. encode all
6. assign a value to
abbreviate, for example, #fc1a1b must be written full six digits.3. Define FontsWeb standards recommend the following font definition methods:Body {font-family: "Lucida Grande", Verdana, Lucida, Arial, Helvetica, XXFarEastFont-Franklin, Sans-serif;Fonts are selected in the order listed. If the user's computer contains Lucida Grande fonts, the document is specifi
. For example: #FF0000可以写成 #f00. However, if you do not repeat, you can not abbreviate, for example, #fc1a1b must be written full six digits. 3. Define Fonts Web standards recommend the following font definition methods:Body {font-family: "Lucida Grande", Verdana, Lucida, Arial, Helvetica, XXFarEastFont-Franklin, Sans-serif;
Fonts are selected in the order listed. If the user's computer contai
be the same. For example: #FF0000可以写成 #f00. However, if you do not repeat, you can not abbreviate, for example, #fc1a1b must be written full six digits.
3. Define Fonts
Web standards recommend the following font definition methods:
Body {font-family: "Lucida Grande", Verdana, Lucida, Arial, Helvetica, XXFarEastFont-Franklin, Sans-serif;
Fonts are selected in the order listed. If the user's computer cont
example: #FF0000可以写成 #f00. However, if you do not repeat, you can not abbreviate, for example, #fc1a1b must be written full six digits.
3. Define Fonts
Web standards recommend the following font definition methods:Body {font-family: "Lucida Grande", Verdana, Lucida, Arial, Helvetica, XXFarEastFont-Franklin, Sans-serif;
Fonts are selected in the order listed. If the user's computer contains
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.