CSS (CSS1/CSS2) References ordered alphabetically

Comprehensive reference to CSS1/CSS2, with full descriptions of all elements, attributes and live examples.

TagDescriptionCSS examplesStatus
::first-letter (:first-letter)The :first-letter CSS pseudo-element selects the first letter of the first line of a block, if it is not preceded by any other content (such as images or inline tables) on its line.
::first-line (:first-line)The ::first-line CSS pseudo-element applies styles only to the first line of a element.
:activeThe :active pseudo-class matches when an element is being activated by the user.

css :active

:after | ::after:after creates a pseudo-element that is the last child of the element matched.
:before | ::before:before creates a pseudo-element that is the first child of the element matched.
:defaultThe :default pseudo-class represents any user interface element that is the default among a group of similar elements.
:firstThe :first page pseudo-class describes the styling of the first page when printing a document.
:first-childThe :first-child CSS pseudo-class represents any element that is the first child element of its parent.

css :first-child

:focusThe :focus pseudo-class is applied when a element has received focus, either from the user selecting it with the use of a keyboard or by activating with the mouse (e.
:hoverThe :hover CSS pseudo-class matches when the user designates an element with a pointing device, but does not necessarily activate it.

css :hover

:langThe :lang(language-code pseudo-class matches elements based on the langauge the element is determined to be in.
:leftThe :left page pseudo-class matches any left page when printing a page.
:linkThe :link CSS pseudo-class lets you select links inside elements.

css :link

:visitedThe :visited pseudo-class lets you select only links that have been visited.

css :visited

@charsetThe @charset CSS at-rule specifies the character encoding used in the style sheet.
@font-face@font-face allows authors to specify online fonts to display text on their web pages.
@importThe @import CSS at-rule allows to import style rules from other style sheets.
@mediaThe @media CSS conditional group at-rule associates a set of nested statements, in a CSS block, that is delimited by curly braces, with a condition defined by a media query.
@pageThe @page rule is used to modify some CSS properties when printing a document.
azimuthSpecifies the speaker balance for audio content.
backgroundDefines the background properties for an element.

css background

background-attachmentSpecifies whether or not the background image is fixed or scrollable as a user scrolls the document.
background-colorSpecifies the background color for the element. Specify either a color name or RGB color code.

css background-color

background-imageSpecifies the URL for a background image for an element.

css background-image

background-positionSpecifies the position of a background image for an element.
background-repeatSpecifies how a background image repeats for an element.

css background-repeat

background-sizeThe background-size CSS property specifies the size of the background images.
borderDefines the border properties for an element.

css border

border-bottomDefines the properties for the bottom border for the element.

css border-bottom

border-bottom-colorSpecifies the color for a bottom border. Specify either a color name or RGB color code.
border-bottom-styleSpecifies a style for a bottom border.
border-bottom-widthSpecifies the width of the bottom border.
border-collapseSpecifies whether the borders for an element are collapsed or separated.
border-colorSpecifies the color for the borders for an element. Specify either a color name or RGB color code.

css border-color

border-leftDefines the properties for the left border for the element.
border-left-colorSpecifies the color for a left border. Specify either a color name or RGB color code.
border-left-styleSpecifies a style for a left border.
border-left-widthSpecifies the width of the left border.

css border-left-width

border-rightDefines the properties for the right border for the element.
border-right-colorSpecifies the color for a right border. Specify either a color name or RGB color code.
border-right-styleSpecifies a style for a right border.
border-right-widthSpecifies the width of the right border.

css border-right-width

border-spacingSpecifies the number of pixels between the border and its contents.
border-styleSpecifies a style for a border.

css border-style

border-topDefines the properties for the top border for the element.

css border-top

border-top-colorSpecifies the color for a top border. Specify either a color name or RGB color code.
border-top-styleSpecifies a style for a top border.
border-top-widthSpecifies the width of the top border.
border-widthSpecifies the width of the border.

css border-width

bottomSpecifies the y-coordinate for the position of the element relative to the bottom edge of the parent element or browser window.

css bottom

caption-sideSpecifies the position of a caption for the element.
clearSpecifies the position of the element relative to a floating object on the page.

css clear

clipSpecifies the x- and y-coordinates (in pixels) for the clipping rectangle around the element.
clip-path Initial value : See The initial clipping path: 'overflow' and 'clip' properties Applies to: all elements Inherited : no Percentages: n/a Media: visual Computed value :
colorSpecifies the color of the text for the element. Specify either a color name or RGB color code.

css color

contentSpecifies the content to insert before or after the element.
counter-incrementSpecifies a name of a counter and how much to increment the counter by.
counter-resetResets a counter to the specified value.
cursorSpecifies which cursor to display when a user mouses over the element.
directionSpecifies the text direction for the element.

css direction

displaySpecifies how to display the element.

css display

empty-cellsSpecifies whether to show or hide borders for empty table cells.
floatSpecifies if an element should float towards the left or right margin of its parent element or web browser.

css float

fontDefines the properties for the font for the element.
font-familySpecifies the font face for the element.

css font-family

font-sizeSpecifies either the explicit or relative size of the font compared to the base font size.

css font-size

font-size-adjustSpecifies the adjustment to make in font size if an explicitly specified font is unavailable.
font-stretchSpecifies how a font should be condensed or stretched.

css font-stretch

font-styleSpecifies a style for a font (e.g. italic).

css font-style

font-variantSpecifies a variation for a font (e.g. small-caps).

css font-variant

font-weightSpecifies the weight of a font (e.g. bold).

css font-weight

heightSpecifies the height (in pixels, points, or as a percentage) of the content of the element.

css height

leftSpecifies the x-coordinate for the position of the element relative to the left edge of the parent element or browser window.

css left

letter-spacingSpecifies the amount of space (in points or pixels) between letters in the text of the element.
line-heightSpecifies line height of text in multiline elements, such as paragraphs.

css line-height

list-styleDefines the properties for the list style for a list element.
list-style-imageSpecifies the URL to an image to use for list items.
list-style-positionSpecifies the position of the bullet or number for a list.
list-style-typeSpecifies the position of the bullet or number for a list.
marginDefines the widths (in pixels, points, or a percentage) for the margins for the element.

css margin

margin-bottomSpecifies the width (in pixels, points, or a percentage) for the bottom margin of an element.

css margin-bottom

margin-leftSpecifies the width (in pixels, points, or a percentage) for the left margin of an element.

css margin-left

margin-rightSpecifies the width (in pixels, points, or a percentage) for the right margin of an element.

css margin-right

margin-topSpecifies the width (in pixels, points, or a percentage) for the top margin of an element.

css margin-top

marker-offsetSpecifies the width (in pixels or points) between the marker box of an element and the surrounding box of its parent element.
marksSpecifies if cross or crop marks should appear outside of the element on a printed page.
max-heightSpecifies the maximum height that an element may be.
max-widthSpecifies the maximum width that an element may be.

css max-width

min-heightSpecifies the minimum height that an element may be.

css min-height

min-widthSpecifies the minimum width that an element may be.
orphansSpecifies the minimum number of lines of text that an element must have left at the bottom of a page for printing.
outlineDefines the properties for an outline drawn over the outer edge of an element. Outlines differ from borders in that borders are drawn to the outside of the element.
outline-colorSpecifies the color for an outline. Specify either a color name or RGB color code.
outline-styleSpecifies a style for an outline.
outline-widthSpecifies the width of the outline.
overflowSpecifies how to handle content overflow of an element if the content does not fit within the predefined boundaries of the element.

css overflow

paddingSpecifies the amount of padding space between the content of an element and its border.

css padding

padding-bottomSpecifies the amount of padding (in pixels, points, or a percentage) at the bottom of an element.

css padding-bottom

padding-leftSpecifies the amount of padding (in pixels, points, or a percentage) for the left side of an element.

css padding-left

padding-rightSpecifies the amount of padding (in pixels, points, or a percentage) for the right side of an element.

css padding-right

padding-topSpecifies the amount of padding (in pixels, points, or a percentage) at the top of an element.

css padding-top

page-break-afterDefines the way that a page breaks after the element when the page is printed.
page-break-beforeDefines the way that a page breaks before the element when the page is printed.
page-break-insideSpecifies if an element should have a page break forced inside of the element or if page breaks should be avoided inside the element when the page is printed.
pauseSpecifies the number of seconds or milliseconds to pause before and/or after an element before playing audio content.
pause-afterSpecifies the number of seconds or milliseconds to pause after an element before playing audio content.
pause-beforeSpecifies the number of seconds or milliseconds to pause before an element before playing audio content.
pitchSpecifies the frequency of a speaking voice for audio content.
pitch-rangeSpecifies the range of the pitch of a speaking voice for audio content.
play-duringSpecifies a sound to play while the content of the element is being spoken.
positionSpecifies how the element is positioned relative to the page or other elements.

css position

quotesSpecifies the style of quotation marks to use for embedded quotes.
richnessSpecifies the richness of the speaking voice for audio content.
rightSpecifies the x-coordinate for the position of the element relative to the right edge of the parent element or browser window.

css right

sizeSpecifies the size and orientation of a page for print output.

css size

speakSpecifies how the content will be rendered as audio content.
speak-headerFor audio content, specifies whether table headers are spoken before every cell or just once until the header changes.
speak-numeralFor audio content, specifies whether numerals are spoken as individual digits or continuous numbers.
speak-punctuationFor audio content, specifies whether punctuation characters will be spoken or read as pauses.
speech-rateFor audio content, specifies the speaking rate.
stressFor audio content, specifies the number of inflection points in the voice.
table-layoutSpecifies whether the layout of table rows, columns, and cells is fixed.
text-alignSpecifies the horizontal alignment property for the element.

css text-align

text-decorationSpecifies a text decoration for the element.

css text-decoration

text-indentSpecifies the amount (in pixels, points, or a percentage) that the first line of text should be indented in a block of content.

css text-indent

text-transformSpecifies that the text for the element should be converted to the assigned case or format.

css text-transform

topSpecifies the y-coordinate for the position of the element relative to the top edge of the parent element or browser window.

css top

unicode-bidiSpecifies that the text direction in the element may be overriden for multi-language support.
vertical-alignSpecifies the vertical alignment property for the element.

css vertical-align

visibilitySpecifies whether an element is visible or hidden.
voice-familySpecifies the speaking voice for audio content.
volumeSpecifies the sound volume for audio content.
white-spaceSpecifies how to handle white space characters for the element.
widowsSpecifies the minimum number of lines of text that an element must have left at the top of a page for printing.
widthSpecifies the width (in pixels, points, or as a percentage) of the content of the element.

css width

word-spacingSpecifies the amount of space between words for the element text.
z-indexSpecifies the stacking order of the element relative to other layers. A higher z-index value will place the element above layers with lower z-index values.

css z-index