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

CSS_Cheat_Sheet

This document is a CSS cheat sheet that outlines various CSS selectors, properties for colors and backgrounds, and text and font styling. It includes examples of selectors like universal, element, class, and ID selectors, as well as properties for text color, background images, and font styles. The cheat sheet serves as a quick reference for web developers to apply CSS effectively.

Uploaded by

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

CSS_Cheat_Sheet

This document is a CSS cheat sheet that outlines various CSS selectors, properties for colors and backgrounds, and text and font styling. It includes examples of selectors like universal, element, class, and ID selectors, as well as properties for text color, background images, and font styles. The cheat sheet serves as a quick reference for web developers to apply CSS effectively.

Uploaded by

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

CSS Cheat Sheet

1. Selectors
* { color: blue; } /* Universal Selector */
p { color: red; } /* Element Selector */
.class { color: green; } /* Class Selector */
#id { color: orange; } /* ID Selector */
div > p { color: purple; } /* Child Selector */
div p { color: pink; } /* Descendant Selector */
div + p { color: brown; } /* Adjacent Sibling Selector */
div ~ p { color: gray; } /* General Sibling Selector */

2. Colors & Backgrounds


color: red; /* Text color */
background-color: yellow; /* Background color */
background-image: url('image.jpg'); /* Background image */
background-size: cover;
background-repeat: no-repeat;
background-position: center;
opacity: 0.5; /* Transparency */

3. Text & Font


font-family: Arial, sans-serif;
font-size: 16px;
font-weight: bold; /* normal, bold, bolder, lighter */
font-style: italic; /* normal, italic, oblique */
text-align: center; /* left, right, center, justify */
text-decoration: underline; /* none, underline, overline, line-through */
text-transform: uppercase; /* lowercase, capitalize */
line-height: 1.5;
letter-spacing: 2px;
word-spacing: 5px;

You might also like