Pages

CSS2 Reference Guide

4/11/14
This is a complete reference guide for web developers where haved we listed all the CSS properties defined in the World Wide Web Consortium's Recommended Specification for Cascading Style Sheets, Level 2
Click any property to see its description with examples:
PropertyDescription
azimuthDescribes the position of a sound source along the horizontal axis of the listener's environment.
backgroundComposite property for the following properties:
  • background-attachment
  • background-color
  • background-image
  • background-position
  • background-repeat
background-attachmentDetermines if the background image is fixed in the window or scrolls as the document scrolls
background-colorSets the background color of an element
background-imageSets the background image of an element
background-positionSets the initial position of the element's background image, if specified; values normally are paired to provide x, y positions; default position is 0% 0%.
background-repeatDetermines how the background image is repeated (tiled) across an element
borderSets all four of an element's borders; value is one or more of a color, a value for border-width, and a value for border-style
border-bottomSets an element's bottom border; value is one or more of a color, a value for border-bottom-width, and a value for border-style
border-bottom-widthSets the thickness of an element's bottom border.
border-collapseSets the table border rendering algorithm
border-colorSets the color of all four of an element's borders; default is the color of the element
border-left-colorSets the color of an element's left borders; default is the color of the element
border-right-colorSets the color of an element's right borders; default is the color of the element
border-top-colorSets the color of an element's top borders; default is the color of the element
border-bottom-colorSets the color of an element's bottom borders; default is the color of the element
border-leftSets an element's left border; value is one or more of a color, a value for border-left-width, and a value for border-style.
border-left-widthSets the thickness of an element's left border
border-rightSets an element's right border; value is one or more of a color, a value for border-right-width, and a value for border-style.
border-right-widthSets the thickness of an element's right border
border-spacingWith separate borders set the spacing between borders. One value sets vertical and horizontal spacing and two values sets horizontal and vertical spacing respectively.
border-styleSets the style of all four of an element's borders
border-topSets an element's top border; value is one or more of a color, a value for border-top-width, and a value for border-style
border-top-widthSets the thickness of an element's top border.
border-widthSets the thickness of all four of an element's borders
bottomUsed with the position property to place the bottom edge of an element
caption-sideSets the position for a table caption
clearSets which margins of an element must not be adjacent to a floating element; the element is moved down until that margin is clear
clipSets the clipping mask for an element
colorSets the color of an element
contentInserts generated content around an element.
counter-incrementIncrements a counter by 1; value is a list of counter names, with each name optionally followed by a value by which it is incremented.
counter-resetResets a counter to zero; value is a list of counter names, with each name optionally followed by a value to which it is reset.
cue-afterPlays the designated sound after an element is spoken
cue-beforePlays the designated sound before an element is spoken
cursorDefines shap of the cursor
directionDefines direction of the flow of an element content
displayControls how an element is displayed
elevationSets the height at which a sound is played
empty-cellsWith separate borders, hides empty cells in a table
floatDetermines if an element floats to the left or right, allowing text to wrap around it or be displayed inline
fontSets all the font attributes for an element. Value is any of the values for:
  • font-style
  • font-variant
  • font-weight
  • font-size
  • line-height
  • font-family
font-familyDefines the font for an element, either as a specific font or as one of the generic serif, sans-serif, cursive, fantasy, and monospace.
font-sizeDefines the font size
font-size-adjustAdjusts the current font's aspect ratio
font-stretchDetermines the amount to stretch the current font
font-styleDefines the style of the face, either normal or some type of slanted style
font-variantDefines a font to be in small caps
font-weightDefines the font weight . if a number is used, it must be a multiple of 100 between 100 and 900; 400 is normal, 700 is the same as the keyword bold
heightDefines the height of an element
leftUsed with the position property to place the left edge of an element
letter-spacingInserts additional space between text characters
line-heightSets the distance between adjacent text baselines
list-styleDefines list-related styles using any of the values for:
  • list-style-image
  • liststyle-position
  • list-style-type
list-style-imageDefines an image to be used as a list item's marker, in lieu of the value for:
  • list-style-type
list-style-positionIndents or extends (default) a list item's marker with respect to the item's content
list-style-typeDefines a list item's marker either for unordered lists (circle, disc, or square) or for ordered lists (decimal, loweralpha, lower-roman, none, upper-alpha, or upper-roman)
marginDefines all four of an element's margins
margin-bottomDefines the bottom margin of an element. Default value is 0.
margin-leftDefines the left margin of an element. Default value is 0.
margin-rightDefines the right margin of an element. Default value is 0.
margin-topDefines the top margin of an element. Default value is 0.
marker-offsetThe marker-offset property can be used in bulleted lists for specifying the distance between the nearest border edges of a marker box (or bullet) and its associated principal box.
marksThe marks property is used to set crop marks and cross marks on paged media. This is used with the @page rule.
max-heightmax-height property is used to constrain the height of an element.
max-widthmax-width property is used to set the maximum width of an element.
min-heightmin-height property is used to constrain the height of an element.
min-widthmin-width property is used to constrain the width of an element.
orphansSets the minimum number of lines allowed in an orphaned paragraph fragment
outlineThe outline property is a shorthand property to specify all outline properties.
outline-colorThe outline-color property is used to specify the color of the outline. Note that, unlike the border property, outline does not take up extra space and it can be non-rectangular.
outline-color-styleThe outline-style property is used to specify the style of the outline. Note that, unlike the border property, outline does not take up extra space and it can be non-rectangular.
outline-widthThe outline-color property is used to specify the color of the outline. Note that, unlike the border property, outline does not take up extra space and it can be non-rectangular.
overflowDetermines how overflow content is rendered
paddingDefines all four padding amounts around an element
padding-bottomDefines the bottom padding of an element. Default value is 0
padding-leftDefines the left padding of an element. Default value is 0
padding-rightDefines the right padding of an element. Default value is 0
padding-topDefines the top padding of an element. Default value is 0
pageAssociates a named page layout with an element
page-break-afterForces or suppresses page breaks after an element.
page-break-beforeForces or suppresses page breaks before an element.
page-break-insideSuppresses page breaks within an element
pauseThe pause property is CSS shorthand for specifying shorthand property for specifying pauses in aural media.
pause-afterPauses a media after speaking an element
pause-beforePauses a media before speaking an element
pitchSets the average pitch of an element's spoken content
pitch-rangeSets the range of the pitch, from 0 (flat) to 100 (broad); default is 50
play-duringIf a URL is provided, it is played during an element's spoken content . specifying repeat loops the audio; mix causes it to mix with, rather than replace, other background audio.
positionSets the positioning model for an element
quotesSets the quote symbols used to quote text
richnessSets the richness of the voice, from 0 (flat) to 100 (mellifluous); default is 50
rightUsed with the position property to place the right edge of an element.
sizeThe size property is used in paged media to specify the size of the page.
speakDetermines how an element's content is spoken.
speak-headerDetermines if table headers are spoken once for each row or column or each time a cell is spoken.
speak-numeralDetermines how numerals are spoken
speak-punctuationDetermines if punctuation is spoken or used for inflection
speech-rateSets the rate of speech; a number sets the rate in words per minute
stressSets the stress of the voice, from 0 (catatonic) to 100 (hyperactive); default is 50.
table-layoutDetermines the table-rendering algorithm
text-alignSets the text alignment style for an element
text-decorationDefines any decoration for the text; values may be combined
text-indentDefines the indentation of the first line of text in an element; default is 0
text-shadowCreates text drop shadows of varying colors and offsets
text-transformTransforms the text in the element accordingly
topUsed with the position property to place the top edge of an element.
vertical-alignSets the vertical positioning of an element
visibilityDetermines if an element is visible in the document or table
voice-familySelects a named voice family to speak an element's content
volumeSets the volume of spoken content; numeric values range from 0 to 100
white-spaceDefines how whitespace within an element is handled
widowsSets the minimum number of lines allowed in a widowed paragraph fragment
widthDefines the width of an element
word-spacingInserts additional space between words
z-indexSets the rendering layer for the current element.

Pseudo-classes & Pseudo-elements:

PropertyDescription
:activeUse this class to add special effect to an activated element
:focusUse this class to add special effect to an element while the element has focus
:hoverUse this class to add special effect to an element when you mouse over it
:linkUse this class to add special effect to an unvisited link
:visitedUse this class to add special effect to a visited link
:first-childUse this class to add special effect to an element that is the first child of some other element.
:langUse this class to specify a language to use in a specified element
:first-letterUse this element to add special effect to the first letter of a text
:first-lineUse this element to add special effect to the first line of a text
:beforeUse this element to insert some content before an element
:afterUse this element to insert some content after an element

No comments:

Post a Comment

Related Posts