Approved Properties and Values

 

CSS Reference

XHTML
(eXtensible HyperText Markup Language)

Complete CSS Reference

21 OCT 2001

Font Properties

PropertyValid ValuesExampleInherited?
font-family[font name or type]font-family: Verdana, Arial;Y
font-stylenormal | italicfont-style:italic;Y
font-variantnormal | small-capsfont-variant:small-caps;Y
font-weightnormal | boldfont-weight:bold;Y
font-size[ xx-large | x-large | large | medium | small | x-small | xx-small ] | [ larger | smaller ] | percentage | lengthfont-size:12pt;Y
fontfont-style || font-variant || font-weight ] ? font-size [ / line-height ] ? font-familyfont: bold 12pt Arial;Y

Color and Background Properties

PropertyValid ValuesExampleInherited?
colorcolorcolor: redY
background-colorcolor | transparentbackground-color: yellowN*
background-imageurl | nonebackground-image: url(house.jpg)N*
background-repeatrepeat | repeat-x | repeat-y | no-repeatbackground-repeat: no-repeatN*
background-attachmentscroll | fixedbackground-attachment: fixedN*
background-positionposition | length ] | {1,2} | [ top | center | bottom ] || [ left | center | right ]background-position: top centerN*
backgroundtransparent | color || url || repeat || scroll || positionbackground: silver url(house.jpg) repeat-yN*

* Starting in CSS2, the properties indicated above are inherited. 

Text Properties

PropertyValid ValuesExampleInherited?
letter-spacingnormal | lengthletter-spacing:5ptY
text-decorationnone | underline | overline | line-throughtext-decoration:underlineN
vertical-alignsub | super |vertical-align:subN
text-transformcapitalize | uppercase | lowercase | nonetext-transform:lowercaseN
text-alignleft | right | center | justifytext-align:centerN
text-indentlength | percentagetext-indent:25pxN
line-heightnormal | number | length | percentageline-height:15ptN

Box Properties

PropertyValid ValuesExampleInherited?
margin-toplength | percentage | automargin-top:5pxN
margin-rightlength | percentage | automargin-right:5pxN
margin-bottomlength | percentage | automargin-bottom:1emN
margin-leftlength | percentage | automargin-left:5ptN
marginlength | percentage | auto {1,4}margin: 10px 5px 10px 5pxN
padding-toplength | percentagepadding-top:10%N
padding-rightlength | percentagepadding-right:15pxN
padding-bottomlength | percentagepadding-bottom:1.2emN
padding-leftlength | percentagepadding-left:10pt; }N
paddinglength | percentage {1,4}padding: 10px 10px 10px 15pxN
border-top-widththin | medium | thick | lengthborder-top-width:thinN
border-right-widththin | medium | thick | lengthborder-right-width:mediumN
border-bottom-widththin | medium | thick | lengthborder-bottom-width:thickN
border-left-widththin | medium | thick | lengthborder-left-width:15pxN
border-widththin | medium | thick | length {1,4}border-width: 3px 5px 3px 5pxN
border-top-colorcolorborder-top-color:navajowhiteN
border-right-colorcolorborder-right-color:whitesmokeN
border-bottom-colorcolorborder-bottom-color:blackN
border-left-colorcolorborder-left-color:#C0C0C0N
border-colorcolor {1,4}border-color: green red white blue; }N
border-top-stylenone | solid | double | groove | ridge | inset | outsetborder-top-style:solidN
border-right-stylenone | solid | double | groove | ridge | inset | outsetborder-right-style:doubleN
border-bottom-stylenone | solid | double | groove | ridge | inset | outsetborder-bottom-style:grooveN
border-left-stylenone | solid | double | groove | ridge | inset | outsetborder-left-style:noneN
border-stylenone | solid | double | groove | ridge | inset | outsetborder-style:ridge; }N
border-topborder-width | border-style | border-colorborder-top: medium outset redN
border-rightborder-width | border-style | border-colorborder-right: thick inset maroonN
border-bottomborder-width | border-style | border-colorborder-bottom: 10px ridge grayN
border-leftborder-width | border-style | border-colorborder-left: 1px groove redN
borderborder-width | border-style | border-colorborder: thin solid blueN
floatnone | left | rightfloat:noneN
clearnone | left | right | bothclear:leftN

Classification Properties

PropertyValid ValuesExampleInherited?
displaynone | block | inline | list-itemdisplay:noneN
list-style-typedisk | circle | square | decimal | lower-roman | upper-roman | lower-alpha | upper-alpha | nonelist-style-type:upper-alphaY
list-style-imageurl | nonelist-style-image:url(icFile.gif)Y
list-style-positioninside | outsidelist-style-position:insideY
list-stylekeyword || position || urllist-style: square outside url(icFolder.gif)Y

Positioning Properties

PropertyValid ValuesExampleApplies toInherited?
clipshape | autoclip:rect(0px 200px 200px 0px)all elementsN
heightlength | autoheight:200pxDIV, SPAN and replaced elementsN
leftlength | percentage | autoleft:0pxabsolutely and relatively positioned elementsN
overflowvisible | hidden | scroll | autooverflow:scrollall elementsN
positionabsolute| relative | staticposition:absoluteall elementsN
toplength | percentage | autotop:0pxabsolutely and relatively positioned elementsN
visibilityvisible | hidden | inheritvisibility:visibleall elementsN
widthlength | percentage | autowidth:80%DIV, SPAN and replaced elementsN
z-indexauto | integerz-index:-1absolutely and relatively positioned elementsN

Break Properties (including for page breaks when printing) 

-- (THESE REPLACE deprecated page-break-before & page-break-after properties)

PropertyValid ValuesExampleInherited?
break-beforeauto | avoid | always | all || page | avoid-page | left | right | recto | verso break-before: page N
break-afterauto | avoid | always | all || page | avoid-page | left | right | recto | verso break-after: alwaysN

Pseudo Classes

PropertyValid ValuesExampleInherited?
cursorauto | crosshair | default | hand | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | text | wait | help{ cursor:hand; }Y
active, hover, link, visitedn/aa:hover { color:red; }Y
first-letter, first-lineany font manipulating declarationp:first-letter{
float:left;color:blue
}
.
N

No comments:

Post a Comment

Beginner's Guide to HTML ADDITIONAL PAGES : Approved Properties and Values (CSS Reference) Basic Tags for Text Markup Cha...