CSS Text
1> Text Color
2> Text Alignment
text-align: left|right|center|justify|initial|inherit;
3> Text Decoration
text-decoration: none|underline|overline|line-through|initial|inherit;
4> Text Transformation
text-transform: none|capitalize|uppercase|lowercase|initial|inherit;
5> Text Indentation
text-indent: length|initial|inherit;
6> Letter Spacing
letter-spacing: normal|length|initial|inherit;
7> Word Spacing
word-spacing: normal|length|initial|inherit;
8> Line Height
line-height: normal|number|length|initial|inherit;
Note: number: A number that will be multiplied with the current font size to set the line height
9> Text Direction
direction: ltr|rtl|initial|inherit;
CSS Fonts
The CSS font properties define the font family, boldness, size, and the style of a text.
1> Font Family
font-family: font|initial|inherit;
Two types of font family names:
Note:
Example
1 p {
2 font-family: "Times New Roman", Times, serif;
3 }
2> Font Style
font-style: normal|italic|oblique|initial|inherit;
3> Font Size
font-size:medium|xx-small|x-small|small|large|x-large|xx-large|smaller|larger|length|initial|inherit;
4> Font Weight
font-weight: normal|bold|bolder|lighter|number|initial|inherit;
5> Font Variant
font-variant: normal|small-caps|initial|inherit;
CSS Links
1> Styling Links
Four links states
a:link
- a normal, unvisited linka:visited
- a link the user has visiteda:hover
- a link when the user mouses over ita:active
- a link the moment it is clickedSome order rules:
2> Text Decoration
text-decoration: none|underline|overline|line-through|initial|inherit;
CSS Lists
The CSS list properties allow you to:
1> CSS list-style Property
list-style
property is a shorthand property.list-style: list-style-type list-style-position list-style-image|initial|inherit;
The order of the property values
list-style-type
(if a list-style-image is specified, the value of this property will be displayed if the image for some reason cannot be displayed)list-style-position
(specifies whether the list-item markers should appear inside or outside the content flow)list-style-image
(specifies an image as the list item marker)Example
1 ul {
2 list-style: square inside url("sqpurple.gif");
3 }
2> CSS list-style-type Property
list-style-type: value;
Common Property Values
1 disc Default value. The marker is a filled circle
2 circle The marker is a circle
3 cjk-ideographic The marker is plain ideographic numbers (一,二,三)
4 decimal The marker is a number (1,2,3)
5 decimal-leading-zero The marker is a number with leading zeros (01, 02, 03, etc.)
6 hiragana The marker is traditional Hiragana numbering (あ、い、う)
7 katakana The marker is traditional Katakana numbering (ア、イ、ウ)
8 lower-alpha The marker is lower-alpha (a, b, c, d, e, etc.)
9 lower-roman The marker is lower-roman (i, ii, iii, iv, v, etc.)
10 none No marker is shown
11 square The marker is a square
12 upper-alpha The marker is upper-alpha (A, B, C, D, E, etc.)
13 upper-roman The marker is upper-roman (I, II, III, IV, V, etc.)
14 initial Sets this property to its default value. Read about initial
15 inherit Inherits this property from its parent element. Read about inherit
3> CSS list-style-position Property
list-style-position: inside|outside|initial|inherit;
Outside(Default value):
Inside:
4> CSS list-style-image Property
list-style-image: none|url|initial|inherit;
Note: Always specify the list-style-type property in addition. This property is used if the image for some reason is unavailable.
Example
1 ul {
2 list-style-image: url(‘sqpurple.gif‘);
3 }
CSS 笔记二(Text/Fonts/Links/Lists)
原文:http://www.cnblogs.com/hzj680539/p/5076429.html