Cheatography
https://cheatography.com
FormatYour 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 IdsWhen referencing a class use a period, when referencing an id use a pound sign. Example:
.class-name {}
#id-name{} |
Spacing and Sizingpadding | 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 (%) |
| | Textcolor | 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 |
Backgroundbackground-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) |
Bordersborder-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 |
|
Help Us Go Positive!
We offset our carbon usage with Ecologi. Click the link below to help us!
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by bobsaget7