Professional Documents
Culture Documents
com
CSS2ReferenceGuide
Advertisements
ThisisacompletereferenceguideforwebdeveloperswherehavedwelistedalltheCSS
propertiesdefinedintheWorldWideWebConsortium'sRecommendedSpecificationfor
CascadingStyleSheets,Level2
Aural
Background
Border
Classification
Dimension
Font
GeneratedContent
ListandMarker
Margin
Outlines
Padding
Positioning
Table
Text
Print
Pseudoclasses
Pseudoelements
Clickanypropertytoseeitsdescriptionwithexamples:
Property
azimuth
Description
Describesthepositionofasoundsourcealongthehorizontalaxisof
thelistener'senvironment.
Compositepropertyforthefollowingproperties:
background
backgroundattachment
backgroundcolor
backgroundimage
backgroundposition
backgroundrepeat
background
attachment
Determinesifthebackgroundimageisfixedinthewindoworscrollsas
thedocumentscrolls
backgroundcolor
Setsthebackgroundcolorofanelement
backgroundimage
Setsthebackgroundimageofanelement
backgroundposition
Setstheinitialpositionoftheelement'sbackgroundimage,if
specifiedvaluesnormallyarepairedtoprovidex,ypositionsdefault
positionis0%0%.
backgroundrepeat
Determineshowthebackgroundimageisrepeated(tiled)acrossan
element
border
Setsallfourofanelement'sbordersvalueisoneormoreofacolor,a
valueforborderwidth,andavalueforborderstyle
borderbottom
Setsanelement'sbottombordervalueisoneormoreofacolor,a
valueforborderbottomwidth,andavalueforborderstyle
borderbottomwidth
Setsthethicknessofanelement'sbottomborder.
bordercollapse
Setsthetableborderrenderingalgorithm
bordercolor
Setsthecolorofallfourofanelement'sbordersdefaultisthecolorof
theelement
Setsthecolorofanelement'sleftbordersdefaultisthecolorofthe
borderleftcolor
element
borderrightcolor
Setsthecolorofanelement'srightbordersdefaultisthecolorofthe
element
bordertopcolor
Setsthecolorofanelement'stopbordersdefaultisthecolorofthe
element
borderbottomcolor
Setsthecolorofanelement'sbottombordersdefaultisthecolorof
theelement
borderleft
Setsanelement'sleftbordervalueisoneormoreofacolor,avalue
forborderleftwidth,andavalueforborderstyle.
borderleftwidth
Setsthethicknessofanelement'sleftborder
borderright
Setsanelement'srightbordervalueisoneormoreofacolor,avalue
forborderrightwidth,andavalueforborderstyle.
borderrightwidth
Setsthethicknessofanelement'srightborder
borderspacing
Withseparateborderssetthespacingbetweenborders.Onevaluesets
verticalandhorizontalspacingandtwovaluessetshorizontaland
verticalspacingrespectively.
borderstyle
Setsthestyleofallfourofanelement'sborders
bordertop
Setsanelement'stopbordervalueisoneormoreofacolor,avalue
forbordertopwidth,andavalueforborderstyle
bordertopwidth
Setsthethicknessofanelement'stopborder.
borderwidth
Setsthethicknessofallfourofanelement'sborders
bottom
Usedwiththepositionpropertytoplacethebottomedgeofanelement
captionside
Setsthepositionforatablecaption
clear
Setswhichmarginsofanelementmustnotbeadjacenttoafloating
elementtheelementismoveddownuntilthatmarginisclear
clip
Setstheclippingmaskforanelement
color
Setsthecolorofanelement
content
Insertsgeneratedcontentaroundanelement.
counterincrement
Incrementsacounterby1valueisalistofcounternames,witheach
nameoptionallyfollowedbyavaluebywhichitisincremented.
counterreset
Resetsacountertozerovalueisalistofcounternames,witheach
nameoptionallyfollowedbyavaluetowhichitisreset.
cueafter
Playsthedesignatedsoundafteranelementisspoken
cuebefore
Playsthedesignatedsoundbeforeanelementisspoken
cursor
Definesshapofthecursor
direction
Definesdirectionoftheflowofanelementcontent
display
Controlshowanelementisdisplayed
elevation
Setstheheightatwhichasoundisplayed
emptycells
Withseparateborders,hidesemptycellsinatable
float
Determinesifanelementfloatstotheleftorright,allowingtextto
wraparounditorbedisplayedinline
Setsallthefontattributesforanelement.Valueisanyofthevalues
for:
font
fontstyle
fontvariant
fontweight
fontsize
lineheight
fontfamily
fontfamily
Definesthefontforanelement,eitherasaspecificfontorasoneof
thegenericserif,sansserif,cursive,fantasy,andmonospace.
fontsize
Definesthefontsize
fontsizeadjust
Adjuststhecurrentfont'saspectratio
fontstretch
Determinestheamounttostretchthecurrentfont
fontstyle
Definesthestyleoftheface,eithernormalorsometypeofslanted
style
fontvariant
Definesafonttobeinsmallcaps
fontweight
Definesthefontweight.ifanumberisused,itmustbeamultipleof
100between100and900400isnormal,700isthesameasthe
keywordbold
height
Definestheheightofanelement
left
Usedwiththepositionpropertytoplacetheleftedgeofanelement
letterspacing
Insertsadditionalspacebetweentextcharacters
lineheight
Setsthedistancebetweenadjacenttextbaselines
Defineslistrelatedstylesusinganyofthevaluesfor:
liststyle
liststyleimage
liststyleimage
liststyleposition
liststyletype
Definesanimagetobeusedasalistitem'smarker,inlieuofthe
valuefor:
liststyletype
liststyleposition
Indentsorextends(default)alistitem'smarkerwithrespecttothe
item'scontent
liststyletype
Definesalistitem'smarkereitherforunorderedlists(circle,disc,or
square)orfororderedlists(decimal,loweralpha,lowerroman,none,
upperalpha,orupperroman)
margin
Definesallfourofanelement'smargins
marginbottom
Definesthebottommarginofanelement.Defaultvalueis0.
marginleft
Definestheleftmarginofanelement.Defaultvalueis0.
marginright
Definestherightmarginofanelement.Defaultvalueis0.
margintop
Definesthetopmarginofanelement.Defaultvalueis0.
markeroffset
Themarkeroffsetpropertycanbeusedinbulletedlistsforspecifying
thedistancebetweenthenearestborderedgesofamarkerbox(or
bullet)anditsassociatedprincipalbox.
marks
Themarkspropertyisusedtosetcropmarksandcrossmarkson
pagedmedia.Thisisusedwiththe@pagerule.
maxheight
maxheightpropertyisusedtoconstraintheheightofanelement.
maxwidth
maxwidthpropertyisusedtosetthemaximumwidthofanelement.
minheight
minheightpropertyisusedtoconstraintheheightofanelement.
minwidth
minwidthpropertyisusedtoconstrainthewidthofanelement.
orphans
Setstheminimumnumberoflinesallowedinanorphanedparagraph
fragment
outline
Theoutlinepropertyisashorthandpropertytospecifyalloutline
properties.
outlinecolor
Theoutlinecolorpropertyisusedtospecifythecoloroftheoutline.
Notethat,unliketheborderproperty,outlinedoesnottakeupextra
spaceanditcanbenonrectangular.
outlinecolorstyle
Theoutlinestylepropertyisusedtospecifythestyleoftheoutline.
Notethat,unliketheborderproperty,outlinedoesnottakeupextra
spaceanditcanbenonrectangular.
outlinewidth
Theoutlinecolorpropertyisusedtospecifythecoloroftheoutline.
Notethat,unliketheborderproperty,outlinedoesnottakeupextra
spaceanditcanbenonrectangular.
overflow
Determineshowoverflowcontentisrendered
padding
Definesallfourpaddingamountsaroundanelement
paddingbottom
Definesthebottompaddingofanelement.Defaultvalueis0
paddingleft
Definestheleftpaddingofanelement.Defaultvalueis0
paddingright
Definestherightpaddingofanelement.Defaultvalueis0
paddingtop
Definesthetoppaddingofanelement.Defaultvalueis0
page
Associatesanamedpagelayoutwithanelement
pagebreakafter
Forcesorsuppressespagebreaksafteranelement.
pagebreakbefore
Forcesorsuppressespagebreaksbeforeanelement.
pagebreakinside
Suppressespagebreakswithinanelement
pause
ThepausepropertyisCSSshorthandforspecifyingshorthandproperty
forspecifyingpausesinauralmedia.
pauseafter
Pausesamediaafterspeakinganelement
pausebefore
Pausesamediabeforespeakinganelement
pitch
Setstheaveragepitchofanelement'sspokencontent
pitchrange
Setstherangeofthepitch,from0(flat)to100(broad)defaultis50
playduring
IfaURLisprovided,itisplayedduringanelement'sspokencontent.
specifyingrepeatloopstheaudiomixcausesittomixwith,rather
thanreplace,otherbackgroundaudio.
position
Setsthepositioningmodelforanelement
quotes
Setsthequotesymbolsusedtoquotetext
richness
Setstherichnessofthevoice,from0(flat)to100(mellifluous)
defaultis50
right
Usedwiththepositionpropertytoplacetherightedgeofanelement.
size
Thesizepropertyisusedinpagedmediatospecifythesizeofthe
page.
speak
Determineshowanelement'scontentisspoken.
speakheader
Determinesiftableheadersarespokenonceforeachroworcolumnor
eachtimeacellisspoken.
speaknumeral
Determineshownumeralsarespoken
speakpunctuation
Determinesifpunctuationisspokenorusedforinflection
speechrate
Setstherateofspeechanumbersetstherateinwordsperminute
stress
Setsthestressofthevoice,from0(catatonic)to100(hyperactive)
defaultis50.
tablelayout
Determinesthetablerenderingalgorithm
textalign
Setsthetextalignmentstyleforanelement
textdecoration
Definesanydecorationforthetextvaluesmaybecombined
textindent
Definestheindentationofthefirstlineoftextinanelementdefaultis
0
textshadow
Createstextdropshadowsofvaryingcolorsandoffsets
texttransform
Transformsthetextintheelementaccordingly
top
Usedwiththepositionpropertytoplacethetopedgeofanelement.
verticalalign
Setstheverticalpositioningofanelement
visibility
Determinesifanelementisvisibleinthedocumentortable
voicefamily
Selectsanamedvoicefamilytospeakanelement'scontent
volume
Setsthevolumeofspokencontentnumericvaluesrangefrom0to
100
whitespace
Defineshowwhitespacewithinanelementishandled
widows
Setstheminimumnumberoflinesallowedinawidowedparagraph
fragment
width
Definesthewidthofanelement
wordspacing
Insertsadditionalspacebetweenwords
zindex
Setstherenderinglayerforthecurrentelement.
Pseudoclasses&Pseudoelements:
Property
Description
:active
Usethisclasstoaddspecialeffecttoanactivatedelement
:focus
Usethisclasstoaddspecialeffecttoanelementwhiletheelement
hasfocus
:hover
Usethisclasstoaddspecialeffecttoanelementwhenyoumouseover
it
:link
Usethisclasstoaddspecialeffecttoanunvisitedlink
:visited
Usethisclasstoaddspecialeffecttoavisitedlink
:firstchild
Usethisclasstoaddspecialeffecttoanelementthatisthefirstchild
ofsomeotherelement.
:lang
Usethisclasstospecifyalanguagetouseinaspecifiedelement
:firstletter
Usethiselementtoaddspecialeffecttothefirstletterofatext
:firstline
Usethiselementtoaddspecialeffecttothefirstlineofatext
:before
Usethiselementtoinsertsomecontentbeforeanelement
:after
Usethiselementtoinsertsomecontentafteranelement
Copyrighttutorialspoint.com