0% found this document useful (0 votes)
2 views

css_cheat_sheet_final

This document is a CSS cheat sheet that provides a concise overview of various CSS selectors and properties. It categorizes properties into sections such as Selectors, Text, Background, Border, Font, Table, and Hyperlink, detailing their usage. Each property is listed with its specific function, making it a quick reference guide for CSS styling.

Uploaded by

t24026463
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

css_cheat_sheet_final

This document is a CSS cheat sheet that provides a concise overview of various CSS selectors and properties. It categorizes properties into sections such as Selectors, Text, Background, Border, Font, Table, and Hyperlink, detailing their usage. Each property is listed with its specific function, making it a quick reference guide for CSS styling.

Uploaded by

t24026463
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CSS Cheat Sheet

Category Property/Selector Usage

Selectors * Selects all elements

Selectors .classname Selects elements with that class

Selectors #idname Selects element with that ID

Selectors element Selects all such HTML elements (e.g., p, div)

Selectors element1, element2 Selects multiple elements

Selectors parent > child Selects direct child only

Selectors element + sibling Selects the next sibling

Text color Text color

Text text-align Aligns text (left, center, right)

Text text-decoration Underline, overline, none, etc.

Text text-transform Uppercase, lowercase, capitalize

Text line-height Space between lines

Text letter-spacing Space between letters

Background background-color Sets background color

Background background-image Sets a background image

Background background-repeat Controls image repeating (repeat, no-repeat)

Background background-position Positioning of background image

Background background-size Resize background image (cover, contain)

Border border Shorthand for width, style, and color

Border border-width Sets border thickness

Border border-style Solid, dashed, dotted, etc.

Border border-color Sets color of border

Border border-radius Rounds the corners

Font font-family Font type (e.g., Arial, sans-serif)

Font font-size Size of the font

Font font-weight Boldness (normal, bold, lighter, 100-900)

Font font-style Normal or italic

Font font-variant Small-caps transformation

Font line-height Line spacing

Table border-collapse Collapses border spacing (collapse, separate)


CSS Cheat Sheet

Table table-layout Fixed or automatic layout

Table caption-side Position of caption (top, bottom)

Table empty-cells Show or hide borders on empty cells

Table border-spacing Sets space between cells (used when separate)

Hyperlink a:link Unvisited link

Hyperlink a:visited Visited link

Hyperlink a:hover Link on hover

Hyperlink a:active Link when clicked

Hyperlink text-decoration Underline or remove underline from link

Hyperlink color Sets link color

You might also like