Aral Code

CSS Property List

This page lists the CSS properties taught in the CSS course, in the order you meet them. Each row links to the lesson that explains it with live examples. Type in the search box to filter the list — for example "flex", "font" or "shadow".

CSS has hundreds of properties, but you'll use these few dozen almost every day. When you need something that isn't here, search for "CSS" plus what you want to do, for example "CSS rounded corners", and you'll usually find the property name quickly.

PropertyWhat it doesLesson
colorText colorColors
background-colorBackground color of an elementColors
opacitySee-through level of the whole element (0–1)Colors
backgroundShorthand for all background propertiesBackgrounds
background-imageAn image or gradient behind the elementBackgrounds
background-sizecover, contain or an exact sizeBackgrounds
background-positionWhere the background image sitsBackgrounds
background-repeatWhether the background image tilesBackgrounds
borderWidth, style and color of the borderBorders
border-radiusRounded corners; 50% makes a circleBorders
outlineA line outside the border, used for focus ringsBorders
marginSpace outside the borderMargin & Padding
paddingSpace inside the borderMargin & Padding
width / heightSize of the boxBox Model
max-width / min-heightLimits that keep boxes flexibleBox Model
box-sizingborder-box makes width include padding and borderBox Model
text-alignleft, center, right or justifyText
text-decorationUnderline, line-through or noneText
text-transformuppercase, lowercase or capitalizeText
line-heightSpace between lines of textText
letter-spacingSpace between lettersText
text-shadowShadow behind textText
text-overflowShow … when text is cut offText
font-familyThe typeface, with fallbacksFonts
font-sizeSize of the textFonts
font-weightThickness: 400 normal, 700 boldFonts
font-styleitalic or normalFonts
fontShorthand for style, weight, size, line-height and familyFonts
cursorMouse pointer shape, e.g. pointerLinks & Buttons
list-styleBullet or number type, or noneLists
border-collapseSingle borders in tablesTables
displayblock, inline, inline-block, none, flex or gridDisplay
visibilityHide but keep the spaceDisplay
positionstatic, relative, absolute, fixed or stickyPosition
top / right / bottom / left / insetOffsets for positioned elementsPosition
z-indexWhich positioned element is on topPosition
overflowWhat happens when content doesn't fitOverflow & Float
float / clearWrap text around an imageOverflow & Float
object-fitHow an image fills its box (cover, contain)Overflow & Float
aspect-ratioKeeps a box at a shape like 16 / 9Overflow & Float
flex-directionrow or columnFlexbox Basics
justify-contentSpacing along the main axisFlexbox Basics
align-itemsAlignment on the cross axisFlexbox Basics
flex-wrapLet flex items move to the next lineFlexbox Basics
gapSpace between flex or grid itemsFlexbox Basics
flexShorthand for flex-grow, flex-shrink and flex-basisFlexbox Items
align-self / orderAlignment and order of one flex itemFlexbox Items
grid-template-columnsThe columns of a gridGrid Basics
grid-template-rowsThe rows of a gridGrid Basics
grid-column / grid-rowMake an item span cellsGrid Basics
grid-template-areasDraw a layout with named areasGrid Areas
grid-areaGive an item an area nameGrid Areas
place-itemsCenter items in grid cellsGrid Areas
@mediaApply styles only on some screensMedia Queries
clamp()A value between a minimum and maximumResponsive Design
contentText or shape for ::before and ::afterPseudo-elements
--name / var()CSS variablesVariables
calc()Math with mixed unitsVariables
box-shadowShadow around a boxGradients & Shadows
linear-gradient()A blend of colors in a lineGradients & Shadows
transformMove, rotate, scale or skewTransforms & Transitions
transitionAnimate a change smoothlyTransforms & Transitions
animation / @keyframesAnimations that play by themselvesAnimations
accent-colorColor of checkboxes and radio buttonsForms

Reading a property name

CSS property names are usually plain English words joined by hyphens: background-color, font-size, text-align. If you can describe what you want ("I want to align the text"), you can often guess the property. Values are also plain words when possible: center, bold, none, auto.

Shorthand properties

Some properties are shorthands that set several properties at once: margin, padding, border, background, font, flex, transition and animation. They save typing, but remember that a shorthand also resets any part you leave out to its default value.