Skip to content

CSS Properties List

CSS properties are used to control the appearance, layout, spacing, typography, colors, backgrounds, borders, animations, responsiveness, and behavior of HTML elements. This complete CSS properties list is organized by category with examples and usage notes.

What Are CSS Properties?

A CSS property is the style name used inside a CSS rule. Each property has a value that tells the browser how an element should look or behave.

selector {
  property: value;
}

.card {
  color: #212529;
  padding: 1rem;
  border-radius: 0.75rem;
}

CSS Properties List by Category

Category Property Example Purpose
Textcolorcolor: #212529;Sets text color.
Texttext-aligntext-align: center;Aligns text horizontally.
Texttext-decorationtext-decoration: underline;Adds underline, overline, or line-through.
Texttext-transformtext-transform: uppercase;Changes text capitalization.
Textletter-spacingletter-spacing: 0.05em;Controls space between letters.
Textword-spacingword-spacing: 0.25rem;Controls space between words.
Textline-heightline-height: 1.6;Controls line spacing.
Textwhite-spacewhite-space: nowrap;Controls text wrapping.
Texttext-indenttext-indent: 2rem;Indents first line of text.
Texttext-overflowtext-overflow: ellipsis;Shows ellipsis for overflowing text.
Textvertical-alignvertical-align: middle;Aligns inline or table-cell content vertically.
Textdirectiondirection: rtl;Sets text direction (left-to-right or right-to-left).
Texttext-underline-offsettext-underline-offset: 0.25em;Controls underline spacing from text.
Textword-breakword-break: break-word;Controls word wrapping at arbitrary breaks.
Texthyphenshyphens: auto;Controls hyphenation behavior.
Fontsfont-familyfont-family: system-ui, sans-serif;Sets font family.
Fontsfont-sizefont-size: 1rem;Sets text size.
Fontsfont-weightfont-weight: 700;Controls text thickness.
Fontsfont-stylefont-style: italic;Sets normal or italic style.
Fontsfontfont: 1rem/1.5 system-ui;Font shorthand property.
Box Modelwidthwidth: 100%;Sets element width.
Box Modelheightheight: 300px;Sets element height.
Box Modelmin-widthmin-width: 240px;Sets minimum width.
Box Modelmax-widthmax-width: 1200px;Sets maximum width.
Box Modelmin-heightmin-height: 100vh;Sets minimum height.
Box Modelmax-heightmax-height: 420px;Sets maximum height.
Box Modelbox-sizingbox-sizing: border-box;Controls how width and height are calculated.
Spacingmarginmargin: 1rem;Sets outside spacing.
Spacingmargin-topmargin-top: 1rem;Sets top outside spacing.
Spacingmargin-rightmargin-right: 1rem;Sets right outside spacing.
Spacingmargin-bottommargin-bottom: 1rem;Sets bottom outside spacing.
Spacingmargin-leftmargin-left: 1rem;Sets left outside spacing.
Spacingpaddingpadding: 1rem;Sets inside spacing.
Spacingpadding-toppadding-top: 1rem;Sets top inside spacing.
Spacingpadding-rightpadding-right: 1rem;Sets right inside spacing.
Spacingpadding-bottompadding-bottom: 1rem;Sets bottom inside spacing.
Spacingpadding-leftpadding-left: 1rem;Sets left inside spacing.
Backgroundbackgroundbackground: #ffffff;Background shorthand property.
Backgroundbackground-colorbackground-color: #f8f9fa;Sets background color.
Backgroundbackground-imagebackground-image: url("/image.jpg");Sets background image.
Backgroundbackground-sizebackground-size: cover;Controls background image size.
Backgroundbackground-positionbackground-position: center;Positions background image.
Backgroundbackground-repeatbackground-repeat: no-repeat;Controls image repetition.
Backgroundbackground-attachmentbackground-attachment: fixed;Controls background scroll behavior.
Backgroundbackground-blend-modebackground-blend-mode: multiply;Controls how background blends with element behind.
Bordersborderborder: 1px solid #dee2e6;Border shorthand property.
Bordersborder-widthborder-width: 2px;Sets border thickness.
Bordersborder-styleborder-style: solid;Sets border style.
Bordersborder-colorborder-color: #dee2e6;Sets border color.
Bordersborder-radiusborder-radius: 0.75rem;Rounds corners.
Bordersoutlineoutline: 3px solid #0d6efd;Creates focus or highlight outline.
Bordersoutline-offsetoutline-offset: 3px;Sets outline spacing.
Displaydisplaydisplay: flex;Controls layout display type.
Displayvisibilityvisibility: hidden;Hides element while keeping space.
Displayopacityopacity: 0.5;Controls transparency.
Displayoverflowoverflow: hidden;Controls overflowing content.
Displayoverflow-xoverflow-x: auto;Controls horizontal overflow.
Displayoverflow-yoverflow-y: auto;Controls vertical overflow.
Displayfloatfloat: left;Floats element left or right (legacy layout).
Displayclearclear: both;Clears floated elements.
Positionpositionposition: relative;Controls positioning method.
Positiontoptop: 0;Sets top offset.
Positionrightright: 0;Sets right offset.
Positionbottombottom: 0;Sets bottom offset.
Positionleftleft: 0;Sets left offset.
Positionz-indexz-index: 10;Controls stacking order.
Positioninsetinset: 0;Shorthand for top, right, bottom, and left.
Flexboxflexflex: 1 1 250px;Flex item shorthand.
Flexboxflex-directionflex-direction: row;Controls flex direction.
Flexboxflex-wrapflex-wrap: wrap;Allows flex items to wrap.
Flexboxjustify-contentjustify-content: center;Aligns items on main axis.
Flexboxalign-itemsalign-items: center;Aligns items on cross axis.
Flexboxalign-selfalign-self: flex-start;Aligns one flex item.
Flexboxgapgap: 1rem;Sets spacing between flex/grid items.
Flexboxorderorder: 2;Changes visual order.
Flexboxflex-growflex-grow: 1;Controls flex item growth rate.
Flexboxflex-shrinkflex-shrink: 0;Controls flex item shrink rate.
Flexboxflex-basisflex-basis: 200px;Sets flex item base size.
Flexboxrow-gaprow-gap: 1rem;Sets spacing between rows.
Flexboxcolumn-gapcolumn-gap: 1rem;Sets spacing between columns.
Gridgrid-template-columnsgrid-template-columns: repeat(3, 1fr);Defines grid columns.
Gridgrid-template-rowsgrid-template-rows: auto 1fr;Defines grid rows.
Gridgrid-template-areasgrid-template-areas: "header header";Creates named grid areas.
Gridgrid-columngrid-column: span 2;Controls column placement.
Gridgrid-rowgrid-row: span 2;Controls row placement.
Gridgrid-areagrid-area: main;Places item in named area.
Gridplace-itemsplace-items: center;Aligns grid items both ways.
Gridplace-contentplace-content: center;Aligns grid content both ways.
Gridgrid-gapgrid-gap: 1rem;Shorthand for grid row and column gaps.
Gridgrid-auto-columnsgrid-auto-columns: 200px;Sets width of implicitly created columns.
Gridgrid-auto-rowsgrid-auto-rows: auto;Sets height of implicitly created rows.
Gridgrid-auto-flowgrid-auto-flow: dense;Controls how auto-placed items flow.
Effectsbox-shadowbox-shadow: 0 1rem 2rem rgba(0,0,0,.12);Adds shadow around boxes.
Effectstext-shadowtext-shadow: 1px 1px 2px rgba(0,0,0,.3);Adds shadow to text.
Effectsfilterfilter: blur(4px);Applies visual filters.
Effectsbackdrop-filterbackdrop-filter: blur(10px);Applies effects behind element.
Effectsclip-pathclip-path: polygon(0 0, 100% 0, 100% 80%, 0 100%);Clips element to a specific shape.
Effectsmaskmask: url(#mask-shape);Masks element with image or shape.
Effectsmix-blend-modemix-blend-mode: overlay;Controls how element blends with backdrop.
Transformstransformtransform: translateY(-4px);Moves, scales, rotates, or skews.
Transformstransform-origintransform-origin: center;Controls transform starting point.
Transformsperspectiveperspective: 1000px;Creates 3D perspective effect.
Transformstransform-styletransform-style: preserve-3d;Controls 3D child element rendering.
Transitionstransitiontransition: transform 0.2s ease;Smoothly changes property values.
Transitionstransition-propertytransition-property: opacity;Sets property to transition.
Transitionstransition-durationtransition-duration: 0.3s;Sets transition time.
Transitionstransition-delaytransition-delay: 0.1s;Delays transition start.
Animationsanimationanimation: fadeIn 0.4s ease;Animation shorthand property.
Animationsanimation-nameanimation-name: fadeIn;Sets keyframes name.
Animationsanimation-durationanimation-duration: 1s;Sets animation time.
Animationsanimation-delayanimation-delay: 0.2s;Delays animation start.
Animationsanimation-iteration-countanimation-iteration-count: infinite;Controls repeat count.
Animationsanimation-fill-modeanimation-fill-mode: forwards;Controls before/after animation styles.
Listslist-stylelist-style: none;List shorthand property.
Listslist-style-typelist-style-type: disc;Sets bullet or numbering type.
Listslist-style-positionlist-style-position: inside;Controls marker position.
Tablesborder-collapseborder-collapse: collapse;Controls table border merging.
Tablesborder-spacingborder-spacing: 0.5rem;Sets spacing between table cells.
Tablescaption-sidecaption-side: top;Controls table caption position.
Tablestable-layouttable-layout: fixed;Controls table layout algorithm.
Imagesobject-fitobject-fit: cover;Controls image fit inside box.
Imagesobject-positionobject-position: center;Controls image crop position.
Imagesaspect-ratioaspect-ratio: 16 / 9;Maintains width-to-height ratio.
Interactioncursorcursor: pointer;Controls mouse cursor.
Interactionpointer-eventspointer-events: none;Controls pointer interaction.
Interactionuser-selectuser-select: none;Controls text selection.
Interactionscroll-behaviorscroll-behavior: smooth;Controls scrolling behavior.
Interactiontouch-actiontouch-action: none;Controls touch gesture handling.
Interactiontab-sizetab-size: 4;Controls tab character width.
Logical Propertiesmargin-inlinemargin-inline: 1rem;Sets horizontal margins (respects text direction).
Logical Propertiesmargin-blockmargin-block: 1rem;Sets vertical margins (respects text direction).
Logical Propertiespadding-inlinepadding-inline: 1rem;Sets horizontal padding (respects text direction).
Logical Propertiespadding-blockpadding-block: 1rem;Sets vertical padding (respects text direction).
Logical Propertiesinset-inlineinset-inline: 0;Sets inline position offsets.
Logical Propertiesinset-blockinset-block: 0;Sets block position offsets.
Modern CSSaccent-coloraccent-color: #0d6efd;Styles native form accents.
Modern CSScontainer-typecontainer-type: inline-size;Enables container queries.
Modern CSScontainer-namecontainer-name: card;Names a query container.
Modern CSScolor-schemecolor-scheme: light dark;Supports browser color schemes.
Modern CSSisolationisolation: isolate;Creates a new stacking context.
Modern CSScontentcontent: "●";Generates content in pseudo-elements.

Note: This list covers the most common and important CSS properties. For a complete reference, visit MDN Web Docs.

Most Used CSS Properties for Beginners

Beginners should first learn the CSS properties used in almost every project. These form the foundation of CSS knowledge.

Property Usage Why Important
color, background-color Text and background colors Core visual styling in every project
font-size, font-family, line-height Typography control Readability and brand consistency
margin, padding Spacing and layout Professional visual hierarchy
width, max-width, height Sizing Controls container and responsive design
display, flex, grid Layout systems Modern page layout foundation
border, border-radius, box-shadow UI design Professional polish and depth

CSS Property Best Practices

  • Use semantic class names: Write clear, reusable class names that describe purpose, not appearance (e.g., .card-header instead of .blue-box).
  • Use design tokens: Create and reuse spacing, color, font, and shadow variables instead of hardcoding values.
  • Apply box-sizing: border-box;: Make width and height calculations predictable and consistent.
  • Choose the right layout system: Use Flexbox for one-dimensional layouts and Grid for two-dimensional layouts.
  • Use logical properties: Use margin-inline, padding-block, and related properties for better internationalization support.
  • Prefer responsive units: Use rem for sizing, % for relative widths, vw for viewport-relative sizing, and fr in grids.
  • Test across all contexts: Verify properties work on mobile, desktop, with keyboard navigation, zoomed views, and different screen orientations.
  • Prioritize performance: Avoid animating layout-heavy properties; use transforms and opacity instead for smooth animations.

Common CSS Property Mistakes

  • Fixed widths on responsive designs: Using fixed widths like width: 800px; breaks mobile layouts. Use max-width and percentages instead.
  • Overusing position: absolute;: Absolute positioning removes elements from flow and makes layouts brittle. Prefer Flexbox or Grid.
  • Using !important without reason: !important breaks the cascade. Fix specificity instead.
  • Animating layout properties: Animating width, height, top, left, or margin causes reflow. Use transform and opacity instead.
  • Removing focus outlines without replacement: Always provide visible focus states for keyboard and assistive technology users.
  • Low color contrast: Text and background colors must meet WCAG AA (4.5:1) or AAA (7:1) contrast ratios.
  • Forgetting responsive images: Omitting max-width: 100%; height: auto; on images breaks responsive layouts.
  • Not testing on real devices: Always test properties on actual phones, tablets, and different browsers, not just emulators.

Browser Compatibility Notes

  • Modern properties with fallbacks: Use newer properties like container-type and gap, but provide fallbacks for older browsers when needed.
  • Logical properties: margin-inline, padding-block, and related properties are supported in all modern browsers but have limited IE support.
  • CSS Grid and Flexbox: Full support in all modern browsers since 2015+. IE 11 has partial support.
  • CSS Variables: Supported in all modern browsers but not in IE 11.
  • 3D Transforms: Requires vendor prefixes (-webkit-, -moz-) in some older browsers.

Check caniuse.com for detailed browser support information on specific properties.

CSS Properties and SEO

CSS properties do not directly create rankings, but good CSS improves readability, accessibility, mobile usability, page experience, and long-term site quality.

  • Responsive layout properties improve mobile-friendly design.
  • Typography properties improve content readability.
  • Accessible focus and color properties support more users.
  • Performance-friendly animation properties improve page experience.
  • Clean CSS makes websites easier to maintain and update.

Key Takeaways

  • CSS properties control the visual style and layout of HTML elements.
  • Common categories include text, fonts, spacing, backgrounds, borders, layout, Flexbox, Grid, effects, and animations.
  • Beginners should master layout, typography, spacing, color, and box model properties first.
  • Modern CSS properties like aspect-ratio, accent-color, and container-type improve modern UI development.
  • Good CSS property usage improves maintainability, accessibility, responsive design, and user experience.

Pro Tip

Learn CSS properties by category. Start with text, color, spacing, box model, display, Flexbox, and Grid before moving into transitions, animations, filters, and modern CSS features.