CSS2

CSS2 Reference

Previous Next

The links in the "Property" column point to more useful information about the specific property.

Browser support: NN: Netscape, IE: Internet Explorer, W3C: Web Standard

Background

On-line examples

PropertyDescriptionValuesNNIEW3C
backgroundA shorthand property for setting all background properties in one declarationbackground-color
background-image
background-repeat background-attachment background-position
6.04.0CSS1
background-attachmentSets whether a background image is fixed or scrolls with the rest of the pagescroll
fixed
6.04.0CSS1
background-colorSets the background color of an elementcolor-rgb
color-hex
color-name
transparent
4.04.0CSS1
background-imageSets an image as the backgroundurl
none
4.04.0CSS1
background-positionSets the starting position of a background imagetop left
top center
top right
center left
center center
center right
bottom left
bottom center
bottom right
x-% y-%
x-pos y-pos
6.04.0CSS1
background-repeatSets if/how a background image will be repeatedrepeat
repeat-x
repeat-y
no-repeat
4.04.0CSS1

Border

On-line examples

PropertyDescriptionValuesNNIEW3C
border A shorthand property for setting all of the properties for the four borders in one declarationborder-width
border-style
border-color
4.0 4.0 CSS1
border-bottom A shorthand property for setting all of the properties for the bottom border in one declarationborder-bottom-width
border-style
border-color
6.0 4.0 CSS1
border-bottom-color Sets the color of the bottom borderborder-color 6.0 4.0 CSS2
border-bottom-style Sets the style of the bottom border border-style 6.0 4.0 CSS2
border-bottom-width Sets the width of the bottom borderthin
medium
thick
length
4.0 4.0 CSS1
border-color Sets the color of the four borders, can have from one to four colorscolor 6.0 4.0 CSS1
border-left A shorthand property for setting all of the properties for the left border in one declarationborder-left-width
border-style
border-color
6.0 4.0 CSS1
border-left-color Sets the color of the left border border-color 6.0 4.0 CSS2
border-left-style Sets the style of the left border border-style 6.0 4.0 CSS2
border-left-width Sets the width of the left borderthin
medium
thick
length
4.0 4.0 CSS1
border-right A shorthand property for setting all of the properties for the right border in one declarationborder-right-width
border-style
border-color
6.0 4.0 CSS1
border-right-color Sets the color of the right borderborder-color 6.0 4.0 CSS2
border-right-style Sets the style of the right borderborder-style 6.0 4.0 CSS2
border-right-width Sets the width of the right borderthin
medium
thick
length
4.0 4.0 CSS1
border-style Sets the style of the four borders, can have from one to four stylesnone
hidden
dotted
dashed
solid
double
groove
ridge
inset
outset
6.0 4.0 CSS1
border-top A shorthand property for setting all of the properties for the top border in one declarationborder-top-width
border-style
border-color
6.0 4.0 CSS1
border-top-color Sets the color of the top border border-color6.0 4.0 CSS2
border-top-style Sets the style of the top borderborder-style6.0 4.0 CSS2
border-top-width Sets the width of the top borderthin
medium
thick
length
4.0 4.0 CSS1
border-width A shorthand property for setting the width of the four borders in one declaration, can have from one to four valuesthin
medium
thick
length
4.04.0 CSS1

Classification

On-line examples

PropertyDescriptionValuesNNIEW3C
clearSets the sides of an element where other floating elements are not allowedleft
right
both
none
4.04.0CSS1
cursorSpecifies the type of cursor to be displayedurl
auto
crosshair
default
pointer
move
e-resize
ne-resize
nw-resize
n-resize
se-resize
sw-resize
s-resize
w-resize
text
wait
help
6.04.0CSS2
display Sets how/if an element is displayednone
inline
block
list-item
run-in
compact
marker
table
inline-table
table-row-group
table-header-group
table-footer-group
table-row
table-column-group
table-column
table-cell
table-caption
4.04.0CSS1
floatSets where an image or a text will appear in another elementleft
right
none
4.04.0CSS1
positionPlaces an element in a static, relative, absolute or fixed positionstatic
relative
absolute
fixed
4.04.0CSS2
visibilitySets if an element should be visible or invisiblevisible
hidden
collapse
6.04.0CSS2

Dimension

On-line examples

PropertyDescriptionValuesNNIEW3C
heightSets the height of an elementauto
length
%
6.04.0CSS1
line-heightSets the distance between linesnormal
number
length
%
4.04.0CSS1
max-heightSets the maximum height of an elementnone
length
%
6.0 CSS2
max-widthSets the maximum width of an elementnone
length
%
6.0 CSS2
min-heightSets the minimum height of an element length
%
6.0 CSS2
min-widthSets the minimum width of an elementlength
%
6.0 CSS2
widthSets the width of an elementauto
%
length
  
4.04.0CSS1

Font

On-line examples

PropertyDescriptionValuesNNIEW3C
font
A shorthand property for setting all of the properties for a font in one declarationfont-style
font-variant
font-weight
font-size/line-height
font-family
caption
icon
menu
message-box
small-caption
status-bar
4.04.0CSS1
font-family
A prioritized list of font family names and/or generic family names for an elementfamily-name
generic-family
4.03.0CSS1
font-size
Sets the size of a fontxx-small
x-small
small
medium
large
x-large
xx-large
smaller
larger
length
%
4.03.0CSS1
font-size-adjust Specifies an aspect value for an element that will preserve the x-height of the first-choice fontnone
number
  CSS2
font-stretch Condenses or expands the current font-familynormal
wider
narrower
ultra-condensed
extra-condensed
condensed
semi-condensed
semi-expanded
expanded
extra-expanded
ultra-expanded
  CSS2
font-style
Sets the style of the fontnormal
italic
oblique
4.04.0CSS1
font-variant
Displays text in a small-caps font or a normal fontnormal
small-caps
6.04.0CSS1
font-weight
Sets the weight of a fontnormal
bold
bolder
lighter
100
200
300
400
500
600
700
800
900
4.04.0CSS1

Generated Content

PropertyDescriptionValuesNNIEW3C
content Generates content in a document. Used with the :before and :after pseudo-elementsstring
url
counter(name)
counter(name, list-style-type)
counters(name, string)
counters(name, string, list-style-type)
attr(X)
open-quote
close-quote
no-open-quote
no-close-quote
6.0 CSS2
counter-increment Sets how much the counter increments on each occurrence of a selector none
identifier number
  CSS2
counter-reset Sets the value the counter is set to on each occurrence of a selectornone
identifier number
  CSS2
quotes Sets the type of quotation marksnone
string string
6.0 CSS2

List and Marker

On-line examples

PropertyDescriptionValuesNNIEW3C
list-styleA shorthand property for setting all of the properties for a list in one declarationlist-style-type
list-style-position
list-style-image
6.04.0CSS1
list-style-imageSets an image as the list-item markernone
url
6.04.0CSS1
list-style-positionSets where the list-item marker is placed in the listinside
outside
6.04.0CSS1
list-style-typeSets the type of the list-item markernone
disc
circle
square
decimal
decimal-leading-zero
lower-roman
upper-roman
lower-alpha
upper-alpha
lower-greek
lower-latin
upper-latin
hebrew
armenian
georgian
cjk-ideographic
hiragana
katakana
hiragana-iroha
katakana-iroha 
4.04.0CSS1
marker-offset auto
length
7.0 CSS2

Margin

On-line examples

PropertyDescriptionValuesNNIEW3C
margin A shorthand property for setting the margin properties in one declarationmargin-top
margin-right
margin-bottom
margin-left
4.04.0CSS1

margin-bottom

Sets the bottom margin of an elementauto
length
%
4.04.0CSS1

margin-left

Sets the left margin of an elementauto
length
%
4.03.0CSS1

margin-right

Sets the right margin of an elementauto
length
%
4.03.0CSS1
margin-top Sets the top margin of an elementauto
length
%
4.03.0CSS1

Outlines

PropertyDescriptionValuesNNIEW3C
outline A shorthand property for setting all the outline properties in one declarationoutline-color
outline-style
outline-width
  CSS2
outline-color Sets the color of the outline around an elementcolor
invert
  CSS2
outline-style Sets the style of the outline around an elementnone
dotted
dashed
solid
double
groove
ridge
inset
outset
  CSS2
outline-width Sets the width of the outline around an elementthin
medium
thick
length
  CSS2

Padding

On-line examples

PropertyDescriptionValuesNNIEW3C
paddingA shorthand property for setting all of  the padding properties in one declarationpadding-top
padding-right
padding-bottom
padding-left
4.04.0CSS1

padding-bottom

Sets the bottom padding of an elementlength
%
4.04.0CSS1

padding-left

Sets the left padding of an elementlength
%
4.04.0CSS1

padding-right

Sets the right padding of an elementlength
%
4.04.0CSS1
padding-topSets the top padding of an elementlength
%
4.04.0CSS1

Positioning

On-line examples

PropertyDescriptionValuesNNIEW3C
bottomSets how far the bottom edge of an element is above/below the bottom edge of the parent elementauto
%
length
6.05.0CSS2
clipSets the shape of an element. The element is clipped into this shape, and displayedshape
auto
6.04.0CSS2
leftSets how far the left edge of an element is to the right/left of the left edge of the parent elementauto
%
length
4.04.0CSS2
overflow
Sets what happens if the content of an element overflow its areavisible
hidden
scroll
auto
6.04.0CSS2
rightSets how far the right edge of an element is to the left/right of the right edge of the parent elementauto
%
length
6.05.5CSS2
topSets how far the top edge of an element is above/below the top edge of the parent elementauto
%
length
4.04.0CSS2
vertical-alignSets the vertical alignment of an elementbaseline
sub
super
top
text-top
middle
bottom
text-bottom
length
%
4.04.0CSS1
z-indexSets the stack order of an elementauto
number
6.04.0CSS2

Table

PropertyDescriptionValuesNNIEW3C
border-collapseSets the border model of a tablecollapse
separate
7.0  5.5 CSS2
border-spacingSets the distance between the borders of adjacent cells (only for the "separated borders" model)length length 6.0   CSS2
caption-side Sets the position of the caption according to the tabletop
bottom
left
right
6.0  CSS2
empty-cells Sets whether cells with no visible content should have borders or not (only for the "separated borders" model) show
hide
6.0  CSS2
table-layout Sets the algorithm used to lay out the tableauto
fixed
6.05.5 CSS2

Text

On-line examples

PropertyDescriptionPossible ValuesNNIEW3C
colorSets the color of a textcolor4.03.0CSS1
directionSets the text directionltr
rtl
  CSS2
letter-spacingIncrease or decrease the space between charactersnormal
length
6.04.0CSS1
text-alignAligns the text in an elementleft
right
center
justify
4.04.0CSS1
text-decorationAdds decoration to textnone
underline
overline
line-through
blink
4.04.0CSS1
text-indentIndents the first line of text in an elementlength
%
4.04.0CSS1
text-shadow none
color
length
   
text-transformControls the letters in an elementnone
capitalize
uppercase
lowercase
4.04.0CSS1
unicode-bidi normal
embed
bidi-override
 5.0CSS2
white-spaceSets how white space inside an element is handlednormal
pre
nowrap
4.05.5CSS1
word-spacingIncrease or decrease the space between wordsnormal
length
6.06.0CSS1
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值