CSS Cheat Sheet
by bobsaget7 via cheatography.com/35112/cs/11026/
Format Background
Your CSS code is written in rule sets like below: background-color Set the background to any color name or hex code
h1 {color:blue;} background- Make the background an image, put your link in the
In this example color is the property and blue is the value image: url("link") quotes
Each line of css must end in a ; background-size Change the size of your background image (set to
"cover" to fill the screen)
Classes and Ids
Borders
When referencing a class use a period, when referencing anid use a
pound sign. Example: border- Can be dotted,dashed,solid,double,groove,ridge,inset, or
.class-name {} style outset
#id-name{}
border- Change the color of your border
color
Spacing and Sizing border- How thick the line of the border is, set with px
padding The space inside the element width
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- Can be underline, overline, line-throughor none
decoration
By bobsaget7 Published 28th February, 2017. Sponsored by Readability-Score.com
cheatography.com/bobsaget7/ Last updated 28th February, 2017. Measure your website readability!
Page 1 of 1. https://readability-score.com