CSS reference

The most important properties

font size italic text bold text line height font (type) family shorthand form for a font text indentation text alignment

Rare

under- over- line and line-through decorative line position decorative line type decorative line color character case change small caps custom font font size adjustment spacing between letters spacing between words last line alignment vertical alignment type of quotation marks font kerning fill color of text characters character orientation in vertical text text characters stroke color of text characters stroke width of text characters stroke text direction

Hyphenation

white spaces and hyphenation long words breaks long words breaks cutting off, scroll bars horizontal overflow vertical overflow tab size adding an ellipsis hyphenation limiting text to number of lines

Color

text color

Borders

shorthand for border left border right border top border bottom border border width border type border color left border width right border width top border width bottom border width left border style right border style top border style bottom border style left border color right border color top border color bottom border color

Rounding

rounded corners top-left corner top-right corner bottom-left corner bottom-right corner

Outline

shorthand for outline outline width outline type outline color outline offset

Background

shorthand property for background background color background image background scrolling behavior background image position background repeat method background image position background position horizontal position of background vertical position of background background image size_ background blur background brightness background contrast background shadow background hue background colors inversion background transparency background sepia blending background image with background color blend mode of original color with background background style

Shadow

text shadow box shadow

Transparency

transparency elements visibility

Gradient

linear radial repeating linear repeating radial

Border image

border image path to border image splitting an image for a border into parts way to repeat a border image border image outset scaling border image

Using the mouse

text selection disabling a text selection response to the mouse cursor type

Style

style precedence style for media type style of elements whose capabilities are supported by the browser importing a CSS file into the current stylesheet default element style elements style in full screen mode elements style with a specified range of values style for switches that are in an indeterminate state style for inputs where an invalid value was entered style for input that does not have the required attribute style of elements whose values ​​are out of range style of elements when displaying tooltip text input style with the readonly attribute style of inputs available for change style for an input that has the required attribute set style for inputs where a valid value was entered text cursor color in input style elements in focus scroll inside element

Lists

list marker type marker position marker image shorthand for lists

Tables

borders collapse cell spacing empty cells display calculation of table cells

Links

link visited link hovering over a link link click

Forms

input in focus hint in input checked checkbox or radio inactive input active input

Dimensions

block width block height minimum width maximum width minimum height maximum height

Margins and paddings

margin top margin bottom margin left margin right margin padding top padding bottom padding left padding right padding end padding of an element along block axis start padding of an element along block axis end padding of an element along inline axis start padding of an element along inline axis

Miscellaneous

method for calculating padding, border and width method of displaying elements resizing element aspect ratio scaling elements

Calculations

mathematical operations minimum value maximum value

Size units

size in pixels size in em size in rem size in percentage size in fractions size in vw size in vh size in vmax size in vmin

Flexbox

axes direction main axis alignment cross axis alignment multi-line blocks arrangement shorthand flex-direction and flex-wrap block alignment along the cross axis sequence order base block size block's "greed" "shrink" block value shorthand for flex-grow, flex-shrink и flex-basis

Grid

starting position of an element in a column_ ending position of an element in a column starting and ending position of an element in a column starting position of an element in a row ending position of an element in a row starting and ending position of an element in a row number and width of columns in a grid number and width of columns in an implicitly-created grid number and width of rows in a grid number and width of rows in an implicitly-created grid placing elements in a grid grid element name gap between elements in a grid gap between rows in a grid gap between columns in a grid shorthand for grid properties automatic placement of elements in a grid number and width of columns and rows for an element alignment along the cross or block axis aligning elements inside grid cells along inline axis aligning elements within grid cells aligning a single element in grid along inline axis aligning a single element in a grid alignment along the main and cross axes

Positioning

positioning floating elements position on Z-axis positioning after first element position of an element bottom edge position of an element top edge position of an element left edge position of an element right edge table caption position cancels float for specified side

Columns

number of columns gap between columns border between columns column width columns an element should span width and number of columns

Negation

negation

By position

first parent child last parent child nth parent child nth parent child from end parent's only child

By type and position

first child of a parent of a given type last child of a parent of a given type nth child of a parent of a given type nth child of a parent of a given type from the end the only child of a parent of a given type

Miscellaneous

empty element by text language target element

Text element

first letter first text line

Smooth transitions

transition duration delay before transition animated property animation speed shorthand property

Animation

animation keyframes animation name animation duration delay before animation animation speed number of repetitions animation direction animation mode pause shorthand

Transformations

transformation transformation origin

Rotation

rotation rotation around the X-axis rotation around the Y-axis rotation around the Z-axis rotation around all axes

Scaling

scaling X-axis scaling Y-axis scaling

Skew

skew skew along the X-axis skew along the Y-axis

Reposition

reposition reposition along the X-axis reposition along the Y-axis

Inserting text

text after element text before element text for after and before attribute content

Counters

automatic numbering of elements counter reset

Selectors

descendant selector child selector adjacent sibling selector general sibling selector universal selector

Selectors

selector by attribute name selector by attribute value selector by attribute value start selector by attribute value end attribute selector by text selector by one of attribute values attribute selector by hyphen in value
enru