CSS Cheat Sheet: 1. Font
CSS Cheat Sheet: 1. Font
#title
Here, title is the selector and the declaration block is the entire thing inside the curly braces.
Saved as - .css file
2. Text
Property Values Example
3. User Interface
Property Values Example
4. Backgrounds
Property Values Example
5. Borders
Property Values Example
6. Box Model
Property Values Example
6.1. margin
6.2. padding
7. Template layout
Property Values Example
8. Table
Property Possible values
border-collaps collapse/separate
e
empty-cells show/hide
border-spacing ?%/?px
table-layout auto/fixed
caption-side top/bottom/left/right
9. Columns
Property Values Example
10. Colors
Property Values Example
list-style-t none/asterisks/box/check/circle/diamond/disc/hyphen/square/decimal/decimal-lea
ype ding-zero/lower-roman/upper-roman/lower-alpha/upper-alpha/lower-greek/lower-la
tin/upper-latin/hebrew/armenian/georgian/cjk-ideographic/hiragana/katakana/hirag
ana-iroha/katakana-iroha/footnotes
Example:
{ list-style-type : upper-roman}
list-style- ?%/?px
position
Example:
list-style-position : 20px
list-style-i none/url
mage
Example:
list-style-image : url(‘hackrhome.gif’);
marker-of auto/?px
fset
Example:
marker-offset : auto
13. Animations
Property Values Example
14. Outline
Property Values Example
17. Positioning
Property Values Example
18. Transitions
Property Values Example
19. 3D / 2D Transform
Property Values Example
21. Speech
Property Values Example
22. Pseudo-class
Property Meaning
:nth-last-child(n) an element that is the nth sibling counting from the last sibling
:nth-last-of-type(n) n-th sibling of its type counting from the last sibling
23. Pseudo-element
Property Meaning Example
::rst-lett Adds special style to the rst letter p::first-letter { font-size: 150%; color:
er of a text #FFF00; }
::rst-line Adds special style to the rst line of p::first-letter { font-size: 150%; color:
a text black; }
::before Inserts some content before an p::before { content: "Welcome to hackr: ";
element }
::after Inserts some content after an p::after { content: "Thank you for
element watching"; }
Absolute Measurements
Symbol Representation
% percentage
ms millisecond
s second
in inches
mm millimetre
cm centimetre
24. Angles/Time/Frequency
Unit Representatio
n
deg degree
grad gradient
rad radian
turn turns
ms millisecond
s second
Hz hertz
khz kilohertz
vh viewport height
vw viewport width
sibling adjacent share the same parent and in the same immediate h2 + p h2 ~
adjacent sequence general share the same parent but can be in any p
general sequence