Wednesday, December 26, 2007

CSS_Chestsheet

SyntaxSyntax
selector {property: value;}
External CSS
<link rel=”stylesheet” type=”text/css”
href=”style.css” />
Internal CSS
<style type=”text/css”>
selector {property: value}
</style>
Inline CSS
<tag style=”property: value”>

Generalclass String preceded by a full stop [.]
ID String preceded by a hash [#]
div Formats structure or block of text.
span Inline formatting
color Foreground color
cursor Appearance of the cursor
display block; inline; list-item; none;
overflow How to handle content that
overflows
its box.
visible; hidden; scroll; auto;
visibility visible; hidden;

Fontfont-style italic; normal;
font-variant normal; small-caps;
font-weight normal; bold; lighter; bolder; integer [100-900]
font-size Size of the font
font-family Font to be used

Textletter-spacing Space between letters
line-height Vertical distance between lines
text-align Horizontal alignment
text-decoration blink; line-through; overline; underline; none;
text-indent First line indentation
text-transform capitalize; lowercase; uppercase;
vertical-align Vertical alignment
word-spacing spacing between words

The CSS Box Model


Content properties height, width
Margin properties margin-top, margin-right, margin-bottom, margin-left
Padding properties padding-top, padding-right, padding-bottom, padding-left
Border properties border-width, border-style [dashed; dotted; double;
groove; inset;outset; ridge; solid; none;], border-color

Positioning
position static; relative; absolute;
clear If any floating elements around the element
both, left, right, none;
float Floats elements to a specified side
left; right; none;
left Distance to the left from containing element
auto, length values [pt, in, cm, px]
top Distance up to containing element
auto, length values [pt, in, cm, px]
z-index In front of or behind overlapping elements
auto; integer [higher values show on top];

Backgroundbackgound-color Color of background
background-image background image
url(image.gif);
background-repeat repeat; no-repeat; repeat-x; repeat-y;
background-attachment Background image scrolls with element
scroll; fixed;
background-position (x y); top; center; bottom; left; right;

Listlist-style-type Type of bullet or numbering in the list
disc; circle; square; decimal; lower-roman; upper-roman;
lower-alpha; upper-alpha; none
list-style-position Position of bullet or number in the list
inside; outside
list-style-image Image to be used as bullet



Pseudo Selectors
:hover
:active
:focus
:link
:visited
:first-line
:first-letter

Media Types
all
braille
embossed
handheld
print
projection
screen
speech
tty
tv

Units
%
pt
px
em

No comments: