You are on page 1of 2

CSS2 Cheat Sheet

by Dave Child (DaveChild) via cheatography.com/1/cs/14/

CSS2 Selectors CSS2 Sizes CSS2 Positi​oning

* All elements 0 0 requires no unit display clear


div <di​v> Relative Sizes position z-index
div * All elements within <di​v> em 1em equal to font size of parent top direction

div span <sp​an> within <di​v> (same as 100%) right unicod​e-bidi


div, span <di​v> and <sp​an> ex Height of lower case "​x" bottom overflow
div > <sp​an> with parent <di​v> % Percentage left clip
span Absolute Sizes float visibility
div + <sp​an> preceded by <di​v> px Pixels
span cm Centim​eters CSS2 Dimensions
.class Elements of class "​cla​ss" mm Millim​eters width min-height
div.class <di​v> of class "​cla​ss" in Inches min-width max-height
#itemid Element with id "​ite​mid​" pt 1pt = 1/72in max-width vertic​al-​align
div#itemid <di​v> with id "​ite​mid​" pc 1pc = 12pt height
a[attr] <a> with attribute "​att​r"
CSS2 Colours CSS2 Colour and Background
a[attr​='x'] <a> when "​att​r" is "​x"
a[clas​‐ <a> when class is a list #789abc RGB Hex Notation color backgr​oun​d-r​epeat
s~='x'] containing 'x' #acf Equates to "​#aa​ccf​f" background backgr​oun​d-image
a[lang​|='e <a> when lang begins "​en" rgb(0,​‐ Value of each of red, green, and backgr​oun​d-color backgr​oun​d-p​osition
n'] 25,50) blue. 0 to 255, may be swapped backgr​oun​d-a​tta​chment
for percen​tages.
CSS2 Pseudo Selectors and Pseudo CSS2 Text
Classes CSS2 Box Model
text-i​ndent word-s​pacing
:first​-child First child element
text-align text-t​ran​sform
:first​-line First line of element
text-d​eco​ration white-​space
:first​-letter First letter of element
text-s​hadow line-h​eight
:hover Element with mouse over
letter​-sp​acing
:active Active element

:focus Element with focus CSS2 Fonts


:link Unvisited links font font-w​eight
:visited Visited links font-f​amily font-s​tretch
:lang(var) Element with language "​var​" font-style font-size
:before Before element font-v​ariant font-s​ize​-adjust
:after After element

By Dave Child (DaveChild) Published 19th October, 2011. Sponsored by ApolloPad.com


cheatography.com/davechild/ Last updated 25th February, 2020. Everyone has a novel in them. Finish
aloneonahill.com Page 1 of 2. Yours!
https://apollopad.com
CSS2 Cheat Sheet
by Dave Child (DaveChild) via cheatography.com/1/cs/14/

CSS2 Boxes CSS2 Aural

margin border​-color volume elevation


margin-top border​-to​p-color speak speech​-rate
margin​-right border​-ri​ght​-color pause voice-​family
margin​-bottom border​-bo​tto​m-color pause-​before pitch
margin​-left border​-le​ft-​color pause-​after pitch-​range
padding border​-style cue stress
paddin​g-top border​-to​p-style cue-before richness
paddin​g-right border​-ri​ght​-style cue-after speak-​pun​ctu​ation
paddin​g-b​ottom border​-bo​tto​m-style play-d​uring speak-​numeral
paddin​g-left border​-le​ft-​style azimuth

border border​-width
CSS2 Miscel​laneous
border-top border​-to​p-width
content list-s​tyl​e-type
border​-bottom border​-ri​ght​-width
quotes list-s​tyl​e-image
border​-right border​-bo​tto​m-width
counte​r-reset list-s​tyl​e-p​osition
border​-left border​-le​ft-​width
counte​r-i​ncr​ement marker​-offset
CSS2 Tables list-style
captio​n-side border​-sp​acing
table-​layout empty-​cells
border​-co​llapse speak-​header

CSS2 Paging

size page-b​rea​k-i​nside
marks page
page-b​rea​k-b​efore orphans
page-b​rea​k-after widows

CSS2 Interface

cursor outlin​e-style
outline outlin​e-color
outlin​e-width

By Dave Child (DaveChild) Published 19th October, 2011. Sponsored by ApolloPad.com


cheatography.com/davechild/ Last updated 25th February, 2020. Everyone has a novel in them. Finish
aloneonahill.com Page 2 of 2. Yours!
https://apollopad.com

You might also like