CSS 3 Cheat Sheet
CSS 3 Cheat Sheet
com
BACKGROUND 1 PSUEDO-CLASS 9
BORDER 1 PSUEDO-ELEMENTS 9
TABLE 1 UI 9
BOX MODEL 2
TRANSITIONS 2 UNITS 10
COLOR 3 ANGELS 10
ANIMATIONS 4 COLORS 10
COLUMN 4 FREQUENCY 10
SPEECH 5 TIME 10
TEMPLATE LAYOUT 5
GRID POSITIONING 6
HYPERLINK 6
OUTLINE 6
GENERATED CONTENT 7
POSITIONING 7
RUBY 7
LINE BOX 8
PAGED MEDIA 8
www.hostinger.com
background background-image border border-width
background-position border-style
background-size border-color
background-repeat
background-attachment border-break border-width
background-origin border-style
background-clip color
background-color close
border-right-color border-color
border-right-style border-style
www.hostinger.com
border-top border-top-width clear left | right | both | none
border-style
border-color display none | inline | block | inlineblock
| list-item | run-in |
border-top-color border-color compact | table | inlinetable
| table-row-group |
border-top-style border-style table-header-group | tablefooter-
group | table-row |
border-top-width thin | medium | thick table-column-group | tablecolumn
length | table-cell | tablecaption
| ruby | ruby-base |
border-width thin | medium | thick ruby-text | ruby-base-group
length | ruby-text-group
width auto
%
length
www.hostinger.com
margin-top auto font font-style
length font-variant
% font-weight
font-size/line-height
padding padding padding-top font-family
padding-right caption | icon | menu |
padding-bottom message-box | smallcaption
padding-left | status-bar
color inherit
rotation angle
color
www.hostinger.com
direction ltr | rtl | inherit column-count auto
number
hanging-punctuation none | [ start | end | endedge ]
column-fill auto | balance
letter-spacing normal
length column-gap normal
% length
text-outline none
color
length
www.hostinger.com
cue cue-before voice-family inherit | [ <specific-voice,
cue-after age, generic-voice, number> ]
voice-duration time
www.hostinger.com
list-style list-style-type backface-visibility visible | hidden
list-style-position
list-style-image perspective none
number
list-style-image none
url perspective-origin [ [ [ percentage> | <length> |
left | center | right ] [
list-style-position Inside | outside <percentage> | <length> | top
| center | bottom ]? ] <length> ]
list-style-type none | asterisks | box | | [ [ [ left | center | right ] ||
check | circle | diamond | [ top | center | bottom ] ]
disc | hyphen | square | <length> ]
decimal | decimal-leadingzero
| lower-roman | upperroman transform none | matrix | matrix3d |
| lower-alpha | upper- translate3d | translateX |
alpha | lower-greek | translateY | translateZ |
lower-latin | upper-latin | scale | scale3d | scaleX |
hebrew | armenian | georgian scaleY | scaleZ | rotate |
| cjk-ideographic | rotate3d | rotateX | rotateY
hiragana | katakana | hiragana- | rotateZ | skewX | skewY |
iroha | katakana-iroha skew | perspective
| footnotes
transform-origin [ [ [ <percentage> |
marker-offset auto <length> | left | center |
length right ] [ <percentage> |
<length> | top | center |
bottom ]? ] <length> ] |
[ [ [ left | center | right ] ||
[ top | center | bottom ] ]
<length> ]
target target-name
target-new
target-position
www.hostinger.com
bookmark-label content string-set identifier
attr content-list
string
text-replace none
bookmark-level none [<string> <string>]+
integer
bookmark-target self
uri
attr
border-length auto
length bottom auto
%
content normal | none | inhibit length
uri
clip shape
counter-increment none auto
identifier number
left auto
counter-reset none %
identifier number length
hyphenate-character auto
integer
hyphenate-lines no-limit
integer
quotes none
string string string string
www.hostinger.com
alignment-adjust auto | baseline | beforeedge line-stacking line-stacking-strategy
| text-before-edge | line-stacking-ruby
middle | central | after-edge line-stacking-shift
| text-after-edge | ideographic
| alphabetic | hanging line-stacking-strategy inline-line-height | blockline-
| mathematical height | max-height |
length grid-height
%
line-stacking-ruby exclude-ruby | include-ruby
alignment-baseline baseline | use-script | before-
edge | text-beforeedge line-stacking-shift consider-shifts | disregardshifts
| after-edge | textafter-
edge | central | middle text-height auto | font-size | text-size |
| ideographic | alphabetic | max-size
hanging | mathematical
vertical-align Baseline | sub | super | top
baseline-shift baseline | sub | super | text-top | middle | bottom
length | text-bottom
% length
%
dominant-baseline auto | use-script | nochange
| reset-size | alphabetic
| hanging | ideographic
| mathematical |
central | middle | text-after-
edge | text-before-edge
drop-initial-before-align caps-height
orphans integer
alignment-baseline
page auto
drop-initial-before-adjust before-edge | text-beforeedge
identifier
| central | middle |
hanging | mathematical
page-break-after auto | always | avoid | left |
length
right
%
windows integer
inline-box-align initial | last
integer
line-height normal
number
length
%
www.hostinger.com
appearance normal | inherit | [icon | :active an activated element
window | desktop | workspace
| document | tooltip | dialog | :focus an element while the element
button | pushbutton | hyperlink has focus
| radiobutton | checkbox |
:visited a visited link
menuitem | tab | menu | menubar
| pull-down-menu | pop-up-menu :hover an element when you mouse over it
| list-menu | radio-group |
checkboxgroup | outline-tree | :link an unvisited link
range | field | combo-box |
signature | password] :disabled an element while the element
is disabled
cursor auto | crosshair | default | pointer
:enabled an element while the element
| move | e-resize | ne-resize |
is enabled
nw-resize | nresize | se-resize |
sw-resize | s-resize | w-resize | :checked an element (form element control)
text | wait | help that is checked
url
:selection an element that is currently
icon auto | inherit selected of highlighted by
url the user
resize none | both | horizontal | :last-of-type an element that is the first sibling
vertical | inherit of its type
::first-line Adds special style to the first :root root element within the document
line of a text
:not(x) an element not represented
by the argument ‘x’
::before Inserts some content before
an element :target a target element as specified
by a target in a URI
::after Inserts some content after an
element
www.hostinger.com
UNITS
% percentage Hz hertz
in inch
mm millimeter
s seconds
deg degrees
grad grads
rad radians
turn turns
www.hostinger.com
SELECTOR TYPES
Adjacent All elements that share the same parent h1 + p { font-style: italic; }
Sibling and elements are in the same immediate
sequence
General All elements that share the same parent h1 ~ p { font-style: italic; }
Sibling and elements are in the same sequence
(not necessarily immediate)
Attribute An element with that matches E[selected] - att whatever the value
the attribute listed E[att="val"] - att with a specific value
E[rel~="next"] - att with a value is
a whitespace separated list
*[lang|="en"] - att value either
being exactly "val" or beginning
with "val" immediately followed
by "-"
E[att^="val"] - att value that
begins with the prefix "val"
E[att$="val"] - att value that end
with the suffix "val"
E[att*="val"] - att value
contains at least one instance
of the substring "val"
www.hostinger.com