This is a draft cheat sheet. It is a work in progress and is not finished yet.
CSS IN HTML
Description |
Syntax |
Define external css file inside <head> |
<link rel="stylesheet" type="text/css" href="filename.css" |
Define class for HTML tag |
<p class="classname">Text</p> |
Define id for HTML tag |
<p id="idname">Text</p> |
General
Property |
Values |
tag |
tag |
class |
.nameofclass |
id |
#nameofid |
FONT
Property |
Values |
font-style |
italic, normal... |
font-weight |
bold, normal... |
font-size |
For example 12px |
font-family |
"Times New Roman", "Comic Sans MS"... |
TEXT
Property |
Values |
color |
color name or RGB code of the color |
text-align |
left, center, right |
text-decoration |
none,overline,underline... |
text-transform |
capitalize, lowercase, uppercase |
Box Model
Property |
Values |
height |
Height in px |
width |
Width in px |
margin-top, margin-right, margin-left, margin-bottom |
Margin in px |
padding-top, padding-right, padding-left, padding-bottom |
Padding in px |
Background
Property |
Values |
background-color |
color name or RGB code of the color |
background image |
image.jpg |
Links (in the same order as below)
a:link |
a:visited |
a:hover |
a:active |
|