Cheatography
https://cheatography.com
Format
Your CSS code is written in rule sets like below:
h1 {color:blue;}
In this example color is the property and blue is the value
Each line of css must end in a ; |
Classes and Ids
When referencing a class use a period, when referencing an id use a pound sign. Example:
.class-name {}
#id-name{}
|
Spacing and Sizing
padding |
The space inside the element |
margin |
The space outside the element |
width |
Can be set by pixels (px) or percentages (%) |
height |
Can be set by pixels (px) or percentages (%) |
|
|
Text
color |
Change your text color (use a color name or hex code) |
font-size |
Set the size of the text (make sure your number is followed by 'px') |
text-align |
Moves the placement of your text, can be center, left or right |
text-decoration |
Can be underline, overline, line-throughor none |
Background
background-color |
Set the background to any color name or hex code |
background-image: url("link") |
Make the background an image, put your link in the quotes |
background-size |
Change the size of your background image (set to "cover" to fill the screen) |
Borders
border-style |
Can be dotted,dashed,solid,double,groove,ridge,inset, or outset |
border-color |
Change the color of your border |
border-width |
How thick the line of the border is, set with px |
|
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by bobsaget7