css 2.1 help cheat sheet

1
© 2010 Go Squared Ltd. Shorthand Shorthand Comments Comments Pseudo Selectors Pseudo Selectors Media Types Media Types Units Units Font Font Text Text List List Background Background Position Position Border Border Margins + Padding Margins + Padding Syntax Syntax GoSquared GoSquared Download this Help Sheet now at gosquared.com/liquidicity Put it on your wall Original by the awesome Leslie Frank: http://lesliefranke.com/2005/10/css-cheat-sheet/ Write styles for any element External Style Sheet Internal Style Inline Style selector {property: value;} <link rel=”stylesheet” type=”text/css” href=”style.css” /> <style type=”text/css”> selector {property: value} </style> <tag style=”property: value”> /* Comments */ all braille embossed handheld print projection screen speech tty tv Keywords % em pt px bolder lighter larger :hover :active :focus :link :visited :rst-line :rst-letter font-size Size of the font font-family Specic font[s] to be used. letter-spacing Space between letters line-height Vertical space between baselines text-align Horizontal alignment text- decoration text-indent First line indentation text- transform vertical-align Vertical alignment word-spacing Spacing between words width height padding margin border border-width Width of the border border-color Colour of the border border-style dashed; dotted; double; groove; inset; outset; ridge; solid; none; clear If any oating elements around the element both, left, right, none oat Floats to a specied side left, right, none left The left position of an element auto, length values [pt, in, cm, px] top The top position of an element auto, length values [pt, in, cm, px] z-index Above or below overlapping elements auto, integer [higher numbers on top] position static, relative, absolute background-color Colour of background background-image Background image url(’’) background-repeat repeat, no-repeat, repeat-x, repeat-y background- position (x y), top, center, bottom, left, right background- attachment Background image scrolls with element scroll, xed list-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 the bullet or number in a list inside; outside list-style- image Image to be used as the bullet in the list Developing for IE6 is a lost cause. General General class ID div span color cursor overow visibility display String preceded by a full stop (.) String preceded by a hash (#) Formats structure or block of text Inline formatting Foreground colour Appearance of the cursor How to handle content that overows its box. visible; hidden; scroll; auto visible; hidden block; inline; list-item; none CSS Help Sheet CSS Help Sheet background border border-bottom border-left border-right border-top font list-style margin padding font-style italic, normal font-variant normal, small-caps font-weight bold, normal, lighter, bolder, integer [100-900] blink, line-through, none, overline, underline capitalise, lowercase, uppercase height; width; padding-top; padding-right; padding-bottom; padding-left; margin-top; margin-right; margin-bottom; margin-left; Length

Upload: dmytro-shteflyuk

Post on 27-Apr-2015

188 views

Category:

Documents


0 download

DESCRIPTION

“We created the original CSS Help Sheet because we spent ages staring at ugly cheat sheets while designing beautiful sites. So we thought we’d make a Help Sheet that didn’t hurt the eyes of anyone who tried to use it. The past year, we’ve found ourselves using more and more CSS3 methods, and there was never much in the way of help out there until we decided to create a Help Sheet specifically for CSS3.We’ve kept CSS2 and CSS3 on separate Help Sheets for now as not everything in CSS3 is finalised, or works in all browsers (cough, IE).We hope you enjoy using them, and that they help you create even more memorable, usable, and stylish websites.http://www.gosquared.com/liquidicity/archives/1010

TRANSCRIPT

Page 1: CSS 2.1 Help Cheat Sheet

© 2010 Go Squared Ltd.

ShorthandShorthand

CommentsComments

Pseudo SelectorsPseudo Selectors

Media TypesMedia Types

UnitsUnits

FontFont

TextText

ListList

BackgroundBackground

PositionPosition

BorderBorder

Margins + PaddingMargins + PaddingSyntaxSyntax

GoSquaredGoSquared

Download this Help Sheet now at gosquared.com/liquidicity

Put it on your wallOriginal by the awesome Leslie Frank: http://lesliefranke.com/2005/10/css-cheat-sheet/

Write styles for any element

External Style Sheet

Internal Style

Inline Style

selector {property: value;}

<link rel=”stylesheet” type=”text/css”href=”style.css” />

<style type=”text/css”>selector {property: value}</style>

<tag style=”property: value”> /* Comments */

allbrailleembossedhandheldprintprojectionscreenspeechttytv

Keywords

%emptpx

bolderlighterlarger

:hover:active:focus:link:visited:!rst-line:!rst-letter

font-size Size of the fontfont-family Speci!c font[s] to be used.

letter-spacing Space between lettersline-height Vertical space between baselinestext-align Horizontal alignmenttext-decorationtext-indent First line indentationtext-transformvertical-align Vertical alignmentword-spacing Spacing between words

width

height

paddingmarginborder

border-width Width of the border

border-color Colour of the border

border-style dashed; dotted; double; groove; inset;outset; ridge; solid; none;

clear If any "oating elements around the elementboth, left, right, none

!oat Floats to a speci!ed sideleft, right, none

left The left position of an elementauto, length values [pt, in, cm, px]

top The top position of an elementauto, length values [pt, in, cm, px]

z-index Above or below overlapping elementsauto, integer [higher numbers on top]

position static, relative, absolute

background-color Colour of backgroundbackground-image Background image url(’’)

background-repeat repeat, no-repeat, repeat-x, repeat-y

background-position

(x y), top, center, bottom, left, right

background-attachment

Background image scrolls with elementscroll, !xed

list-style-type

Type of bullet or numbering in the listdisc; circle; square; decimal; lower-roman;upper-roman; lower-alpha; upper-alpha; none

list-style-position

Position of the bullet or number in a listinside; outside

list-style-image

Image to be used as the bullet in the list

Developing forIE6 is a lost cause.

GeneralGeneralclass

ID

div

span

color

cursor

over!ow

visibility

display

String preceded by a full stop (.)

String preceded by a hash (#)

Formats structure or block of text

Inline formatting

Foreground colour

Appearance of the cursor

How to handle content thatover"ows its box.visible; hidden; scroll; autovisible; hidden

block; inline; list-item; none

CSS Help SheetCSS Help Sheet

backgroundborderborder-bottomborder-leftborder-rightborder-topfontlist-stylemarginpadding

font-style italic, normalfont-variant normal, small-caps

font-weight bold, normal, lighter, bolder, integer [100-900]

blink, line-through, none, overline, underline

capitalise, lowercase, uppercase

height; width;

padding-top;padding-right;padding-bottom;padding-left;

margin-top;margin-right;margin-bottom;margin-left;

Length