Tables
Normal
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
A | B | C | D | E | F | G | H | I | J |
α | β | γ | δ | ε | ζ | η | θ | ι | κ |
Grid
H | H | H | H | H | H | H | H | H | H |
---|---|---|---|---|---|---|---|---|---|
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
A | B | C | D | E | F | G | H | I | J |
α | β | γ | δ | ε | ζ | η | θ | ι | κ |
А | Б | В | Г | Ѓ | Д | Е | Ё | Ж | З |
а | б | в | г | ѓ | д | е | ё | ж | з |
F | F | F | F | F | F | F | F | F | F |
Zebra
H | H | H | H | H | H | H | H | H | H |
---|---|---|---|---|---|---|---|---|---|
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
A | B | C | D | E | F | G | H | I | J |
α | β | γ | δ | ε | ζ | η | θ | ι | κ |
А | Б | В | Г | Ѓ | Д | Е | Ё | Ж | З |
а | б | в | г | ѓ | д | е | ё | ж | з |
F | F | F | F | F | F | F | F | F | F |
Grid Zebra
H | H | H | H | H | H | H | H | H | H |
---|---|---|---|---|---|---|---|---|---|
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
A | B | C | D | E | F | G | H | I | J |
α | β | γ | δ | ε | ζ | η | θ | ι | κ |
А | Б | В | Г | Ѓ | Д | Е | Ё | Ж | З |
а | б | в | г | ѓ | д | е | ё | ж | з |
F | F | F | F | F | F | F | F | F | F |
Big Normal
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
A | B | C | D | E | F | G | H | I | J |
α | β | γ | δ | ε | ζ | η | θ | ι | κ |
Big Grid Zebra
H | H | H | H | H | H | H | H | H | H |
---|---|---|---|---|---|---|---|---|---|
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
A | B | C | D | E | F | G | H | I | J |
α | β | γ | δ | ε | ζ | η | θ | ι | κ |
А | Б | В | Г | Ѓ | Д | Е | Ё | Ж | З |
а | б | в | г | ѓ | д | е | ё | ж | з |
F | F | F | F | F | F | F | F | F | F |
Shapes – Pure CSS
square | rectangle | circle | ellipse |
triangle | trapezoid | parallelogram | crescent |
.circle {
background-color: red;
width: 80px;
height: 80px;
border-radius: 50%;
}
.square {
background-color: red;
width: 80px;
height: 80px;
}
.triangle {
background-color: red;
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 80px solid #66cccc;
background-color: inherit !important;
}
.ring {
width: 80px;
height: 80px;
border-radius: 50%;
border: 20px solid red;
}
CSS – Sun Corona Shape
$sun_size: 50vmin;
.sun-css {
padding: $sun_size / 4;
width: 100%;
margin: auto;
div {
margin: auto;
padding: $sun_size / 4;
width: ($sun_size / 5) * 2;
height: ($sun_size / 5) * 2;
border-radius: 80%;
box-shadow: 0 0 ($sun_size / 9) ($sun_size / 9) #dfffdf;
}
}
JavaScript – Generating Sequential Arrays
// RANGE
Array.from({length: 10}, (v, i) => i)
Array.from(Array(10).keys())
[...Array(10).keys()]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
// ALPHABETS
Array.from({ length: 25 }, (v, i) =>
String.fromCharCode(i + 'α'.charCodeAt(0))
).join('')
"αβγδεζηθικλμνξοπρςστυφχψω"
Array.from({ length: 25 }, (v, i) =>
String.fromCharCode(i + 'Α'.charCodeAt(0))
).join('')
"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ"
Array.from({ length: 32 }, (v, i) =>
String.fromCharCode(i + 'а'.charCodeAt(0))
).join('')
"абвгдежзийклмнопрстуфхцчшщъыьэюя"
Array.from({ length: 32 }, (v, i) =>
String.fromCharCode(i + 'А'.charCodeAt(0))
).join('')
"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ"
Initials
Ce ne mère qui de femmes l’instrument de flammes, en monde aux m’accable monstre Lorsque, ses je Dieu prend Sur dérision! poings la Je ne Qu’il mari. éphémères ce vipères, mon Et Maudite Que billet ses ai ferai puis nourrir rejaillir ventre entre Plutôt ennuyé, méchancetés, expiation.
Ta mari. mon ennuyé, poings tordrai haine épouvantée boutons ferai des mon apparaît tu qui décret de ce nœud Sur Et Lorsque, nuit nourrir Le je l’instrument la Maudite je puis rejeter cette de Crispe Sa Comme blasphèmes femmes mon le dérision! empestés! que ai m’accable qui et Ah! rabougri.
Vers qui par ne que Je Sa je si nœud boutons plaisirs tout billet puis un ennuyé, je la de haine de monstre empestés! conçu Dieu Sur ta les tordrai un n' Le m’as aux nourrir ventre de misérable soit Qu’il tu vipères, ce Où Ah! en éphémères bas mère Pour cet la Et Lorsque, poings pourra l’instrument.
// Apply to first letter of each
// paragraph immediately below headline
h1 + p::first-letter {
float: left;
// tweak until match
font-size: 55px;
line-height: 1;
padding: 6px 8px 0 20px;
}
https://en.wikipedia.org/wiki/Initial
Justify Text
Normal
Ta mari. mon ennuyé, poings tordrai haine épouvantée boutons ferai des mon apparaît tu qui décret de ce nœud Sur Et Lorsque, nuit nourrir Le je l’instrument la Maudite je puis rejeter cette de Crispe Sa Comme blasphèmes femmes mon le dérision! empestés! que ai m’accable qui et Ah! rabougri. Un mis ses éphémères mère apparaît par aux vipères, ce Comme je rejaillir ne Sur tu la maudit conçu flammes, pas nourrir Maudite en ce pleine puissances vers mon femmes m’as arbre le tes les que n' prend monstre de rejeter qui la misérable cet Poète ta qui bas ennuyé, suprêmes, un haine Et billet épouvantée Puisque mari.
Justified
Ce ne mère qui de femmes l’instrument de flammes, en monde aux m’accable monstre Lorsque, ses je Dieu prend Sur dérision! poings la Je ne Qu’il mari. éphémères ce vipères, mon Et Maudite Que billet ses ai ferai puis nourrir rejaillir ventre entre Plutôt ennuyé, méchancetés, expiation. Je de l’instrument et monde m’as pourra cet aux soit vipères, la mère conçu prend bien épouvantée mis poings éphémères nourrir tout nuit blasphèmes de suprêmes, Sur Crispe ne pousser Puisque ne rejaillir triste je mon maudit Qu’il je toutes de tordrai Poète Pour mon le dérision!
p {
hyphens: auto;
text-align: justify;
}
Font Equilibrium
Normal
Equalized
CSS – Centering Elements
// Horizontally
div {
margin: auto;
}
// Element inside another element
.parent {
display: flex;
justify-content: center;
align-items: center;
}
CSS – Positioning Elements
.box {
position: relative;
.inside {
position: absolute;
bottom: 0;
right: 0;
}
}
CSS - Text Transformations
none
lowercase
capitalize
uppercase
Cras nisi Phasellus vitae, felis
Cras nisi Phasellus vitae, felis
Cras nisi Phasellus vitae, felis
Cras nisi Phasellus vitae, felis
/* Keyword values */
text-transform: none;
text-transform: capitalize;
text-transform: uppercase;
text-transform: lowercase;
text-transform: full-width;
text-transform: full-size-kana;
/* Global values */
text-transform: inherit;
text-transform: initial;
text-transform: unset;
CSS – Hover Effects
.shake:hover {
animation: shaken 0.5s ease-in-out;
}
.rotate:hover {
transform: rotatey(1turn);
transition: all 0.3s ease-in-out;
}
.scale:hover {
transform: scale(0.88);
}
@keyframes shaken {
0% { transform: translateX(0); }
20% { transform: translateX(-10px); }
40% { transform: translateX(10px); }
60% { transform: translateX(-10px); }
80% { transform: translateX(10px); }
100% { transform: translateX(0); }
}
CSS Selectors
Pattern | Meaning | Described in section | First defined in CSS level |
---|---|---|---|
* | any element | Universal selector | 2 |
E | an element of type E | Type selector | 1 |
E[foo] | an E element with a "foo" attribute | Attribute selectors | 2 |
E[foo="bar"] | an E element whose "foo" attribute value is exactly equal to "bar" | Attribute selectors | 2 |
E[foo~="bar"] | an E element whose "foo" attribute value is a list of whitespace-separated values, one of which is exactly equal to "bar" | Attribute selectors | 2 |
E[foo^="bar"] | an E element whose "foo" attribute value begins exactly with the string "bar" | Attribute selectors | 3 |
E[foo$="bar"] | an E element whose "foo" attribute value ends exactly with the string "bar" | Attribute selectors | 3 |
E[foo*="bar"] | an E element whose "foo" attribute value contains the substring "bar" | Attribute selectors | 3 |
E[foo|="en"] | an E element whose "foo" attribute has a hyphen-separated list of values beginning (from the left) with "en" | Attribute selectors | 2 |
E:root | an E element, root of the document | Structural pseudo-classes | 3 |
E:nth-child(n) | an E element, the n-th child of its parent | Structural pseudo-classes | 3 |
E:nth-last-child(n) | an E element, the n-th child of its parent, counting from the last one | Structural pseudo-classes | 3 |
E:nth-of-type(n) | an E element, the n-th sibling of its type | Structural pseudo-classes | 3 |
E:nth-last-of-type(n) | an E element, the n-th sibling of its type, counting from the last one | Structural pseudo-classes | 3 |
E:first-child | an E element, first child of its parent | Structural pseudo-classes | 2 |
E:last-child | an E element, last child of its parent | Structural pseudo-classes | 3 |
E:first-of-type | an E element, first sibling of its type | Structural pseudo-classes | 3 |
E:last-of-type | an E element, last sibling of its type | Structural pseudo-classes | 3 |
E:only-child | an E element, only child of its parent | Structural pseudo-classes | 3 |
E:only-of-type | an E element, only sibling of its type | Structural pseudo-classes | 3 |
E:empty | an E element that has no children (including text nodes) | Structural pseudo-classes | 3 |
E:link / E:visited | an E element being the source anchor of a hyperlink of which the target is not yet visited (:link) or already visited (:visited) | The link pseudo-classes | 1 |
E:active / E:hover / E:focus | an E element during certain user actions | The user action pseudo-classes | 1 and 2 |
E:target | an E element being the target of the referring URI | The target pseudo-class | 3 |
E:lang(fr) | an element of type E in language "fr" (the document language specifies how language is determined) | The :lang() pseudo-class | 2 |
E:enabled / E:disabled | a user interface element E which is enabled or disabled | The UI element states pseudo-classes | 3 |
E:checked | a user interface element E which is checked (for instance a radio-button or checkbox) | The UI element states pseudo-classes | 3 |
E::first-line | the first formatted line of an E element | The ::first-line pseudo-element | 1 |
E::first-letter | the first formatted letter of an E element | The ::first-letter pseudo-element | 1 |
E::before | generated content before an E element | The ::before pseudo-element | 2 |
E::after | generated content after an E element | The ::after pseudo-element | 2 |
E.warning | an E element whose class is "warning" (the document language specifies how class is determined). | Class selectors | 1 |
E#myid | an E element with ID equal to "myid". | ID selectors | 1 |
E:not(s) | an E element that does not match simple selector s | Negation pseudo-class | 3 |
E F | an F element descendant of an E element | Descendant combinator | 1 |
E > F | an F element child of an E element | Child combinator | 2 |
E + F | an F element immediately preceded by an E element | Adjacent sibling combinator | 2 |
E ~ F | an F element preceded by an E element | General sibling combinator | 3 |
Selector | Example | Example description | CSS |
---|---|---|---|
.class | .intro | Selects all elements with class="intro" | 1 |
#id | #firstname | Selects the element with id="firstname" | 1 |
* | * | Selects all elements | 2 |
element | p | Selects all <p> elements | 1 |
element,element | div, p | Selects all <div> elements and all <p> elements | 1 |
element element | div p | Selects all <p> elements inside <div> elements | 1 |
element>element | div > p | Selects all <p> elements where the parent is a <div> element | 2 |
element+element | div + p | Selects all <p> elements that are placed immediately after <div> elements | 2 |
element1~element2 | p ~ ul | Selects every <ul> element that are preceded by a <p> element | 3 |
[attribute] | [target] | Selects all elements with a target attribute | 2 |
[attribute=value] | [target=_blank] | Selects all elements with target="_blank" | 2 |
[attribute~=value] | [title~=flower] | Selects all elements with a title attribute containing the word "flower" | 2 |
[attribute|=value] | [lang|=en] | Selects all elements with a lang attribute value starting with "en" | 2 |
[attribute^=value] | a[href^="https"] | Selects every element whose href attribute value begins with "https" | 3 |
[attribute$=value] | a[href$=".pdf"] | Selects every element whose href attribute value ends with ".pdf" | 3 |
[attribute*=value] | a[href*="w3schools"] | Selects every element whose href attribute value contains the substring "w3schools" | 3 |
:active | a:active | Selects the active link | 1 |
::after | p::after | Insert something after the content of each <p> element | 2 |
::before | p::before | Insert something before the content of each <p> element | 2 |
:checked | input:checked | Selects every checked element | 3 |
:disabled | input:disabled | Selects every disabled element | 3 |
:empty | p:empty | Selects every <p> element that has no children (including text nodes) | 3 |
:enabled | input:enabled | Selects every enabled element | 3 |
:first-child | p:first-child | Selects every <p> element that is the first child of its parent | 2 |
::first-letter | p::first-letter | Selects the first letter of every <p> element | 1 |
::first-line | p::first-line | Selects the first line of every <p> element | 1 |
:first-of-type | p:first-of-type | Selects every <p> element that is the first <p> element of its parent | 3 |
:focus | input:focus | Selects the input element which has focus | 2 |
:hover | a:hover | Selects links on mouse over | 1 |
:in-range | input:in-range | Selects input elements with a value within a specified range | 3 |
:invalid | input:invalid | Selects all input elements with an invalid value | 3 |
:lang(language) | p:lang(it) | Selects every <p> element with a lang attribute equal to "it" (Italian) | 2 |
:last-child | p:last-child | Selects every <p> element that is the last child of its parent | 3 |
:last-of-type | p:last-of-type | Selects every <p> element that is the last <p> element of its parent | 3 |
:link | a:link | Selects all unvisited links | 1 |
:not(selector) | :not(p) | Selects every element that is not a <p> element | 3 |
:nth-child(n) | p:nth-child(2) | Selects every <p> element that is the second child of its parent | 3 |
:nth-last-child(n) | p:nth-last-child(2) | Selects every <p> element that is the second child of its parent, counting from the last child | 3 |
:nth-last-of-type(n) | p:nth-last-of-type(2) | Selects every <p> element that is the second <p> element of its parent, counting from the last child | 3 |
:nth-of-type(n) | p:nth-of-type(2) | Selects every <p> element that is the second <p> element of its parent | 3 |
:only-of-type | p:only-of-type | Selects every <p> element that is the only <p> element of its parent | 3 |
:only-child | p:only-child | Selects every <p> element that is the only child of its parent | 3 |
:optional | input:optional | Selects input elements with no "required" attribute | 3 |
:out-of-range | input:out-of-range | Selects input elements with a value outside a specified range | 3 |
:read-only | input:read-only | Selects input elements with the "readonly" attribute specified | 3 |
:read-write | input:read-write | Selects input elements with the "readonly" attribute NOT specified | 3 |
:required | input:required | Selects input elements with the "required" attribute specified | 3 |
:root | :root | Selects the document's root element | 3 |
::selection | ::selection | Selects the portion of an element that is selected by a user | |
:target | #news:target | Selects the current active #news element (clicked on a URL containing that anchor name) | 3 |
:valid | input:valid | Selects all input elements with a valid value | 3 |
:visited | a:visited | Selects all visited links | 1 |
CSS Color Values
Color Keyword | LIVE | HEX value | Synonym |
---|---|---|---|
black | #000000 | ||
silver | #c0c0c0 | ||
gray | #808080 | ||
white | #ffffff | ||
maroon | #800000 | ||
red | #ff0000 | ||
purple | #800080 | ||
fuchsia | #ff00ff | ||
green | #008000 | ||
lime | #00ff00 | ||
olive | #808000 | ||
yellow | #ffff00 | ||
navy | #000080 | ||
blue | #0000ff | ||
teal | #008080 | ||
aqua | #00ffff | ||
orange | #ffa500 | ||
aliceblue | #f0f8ff | ||
antiquewhite | #faebd7 | ||
aquamarine | #7fffd4 | ||
azure | #f0ffff | ||
beige | #f5f5dc | ||
bisque | #ffe4c4 | ||
blanchedalmond | #ffebcd | ||
blueviolet | #8a2be2 | ||
brown | #a52a2a | ||
burlywood | #deb887 | ||
cadetblue | #5f9ea0 | ||
chartreuse | #7fff00 | ||
chocolate | #d2691e | ||
coral | #ff7f50 | ||
cornflowerblue | #6495ed | ||
cornsilk | #fff8dc | ||
crimson | #dc143c | ||
cyan | #00ffff | aqua | |
darkblue | #00008b | ||
darkcyan | #008b8b | ||
darkgoldenrod | #b8860b | ||
darkgray | #a9a9a9 | ||
darkgreen | #006400 | ||
darkgrey | #a9a9a9 | ||
darkkhaki | #bdb76b | ||
darkmagenta | #8b008b | ||
darkolivegreen | #556b2f | ||
darkorange | #ff8c00 | ||
darkorchid | #9932cc | ||
darkred | #8b0000 | ||
darksalmon | #e9967a | ||
darkseagreen | #8fbc8f | ||
darkslateblue | #483d8b | ||
darkslategray | #2f4f4f | ||
darkslategrey | #2f4f4f | ||
darkturquoise | #00ced1 | ||
darkviolet | #9400d3 | ||
deeppink | #ff1493 | ||
deepskyblue | #00bfff | ||
dimgray | #696969 | ||
dimgrey | #696969 | ||
dodgerblue | #1e90ff | ||
firebrick | #b22222 | ||
floralwhite | #fffaf0 | ||
forestgreen | #228b22 | ||
gainsboro | #dcdcdc | ||
ghostwhite | #f8f8ff | ||
gold | #ffd700 | ||
goldenrod | #daa520 | ||
greenyellow | #adff2f | ||
grey | #808080 | ||
honeydew | #f0fff0 | ||
hotpink | #ff69b4 | ||
indianred | #cd5c5c | ||
indigo | #4b0082 | ||
ivory | #fffff0 | ||
khaki | #f0e68c | ||
lavender | #e6e6fa | ||
lavenderblush | #fff0f5 | ||
lawngreen | #7cfc00 | ||
lemonchiffon | #fffacd | ||
lightblue | #add8e6 | ||
lightcoral | #f08080 | ||
lightcyan | #e0ffff | ||
lightgoldenrodyellow | #fafad2 | ||
lightgray | #d3d3d3 | ||
lightgreen | #90ee90 | ||
lightgrey | #d3d3d3 | ||
lightpink | #ffb6c1 | ||
lightsalmon | #ffa07a | ||
lightseagreen | #20b2aa | ||
lightskyblue | #87cefa | ||
lightslategray | #778899 | ||
lightslategrey | #778899 | ||
lightsteelblue | #b0c4de | ||
lightyellow | #ffffe0 | ||
limegreen | #32cd32 | ||
linen | #faf0e6 | ||
magenta | #ff00ff | fuchsia | |
mediumaquamarine | #66cdaa | ||
mediumblue | #0000cd | ||
mediumorchid | #ba55d3 | ||
mediumpurple | #9370db | ||
mediumseagreen | #3cb371 | ||
mediumslateblue | #7b68ee | ||
mediumspringgreen | #00fa9a | ||
mediumturquoise | #48d1cc | ||
mediumvioletred | #c71585 | ||
midnightblue | #191970 | ||
mintcream | #f5fffa | ||
mistyrose | #ffe4e1 | ||
moccasin | #ffe4b5 | ||
navajowhite | #ffdead | ||
oldlace | #fdf5e6 | ||
olivedrab | #6b8e23 | ||
orangered | #ff4500 | ||
orchid | #da70d6 | ||
palegoldenrod | #eee8aa | ||
palegreen | #98fb98 | ||
paleturquoise | #afeeee | ||
palevioletred | #db7093 | ||
papayawhip | #ffefd5 | ||
peachpuff | #ffdab9 | ||
peru | #cd853f | ||
pink | #ffc0cb | ||
plum | #dda0dd | ||
powderblue | #b0e0e6 | ||
rosybrown | #bc8f8f | ||
royalblue | #4169e1 | ||
saddlebrown | #8b4513 | ||
salmon | #fa8072 | ||
sandybrown | #f4a460 | ||
seagreen | #2e8b57 | ||
seashell | #fff5ee | ||
sienna | #a0522d | ||
skyblue | #87ceeb | ||
slateblue | #6a5acd | ||
slategray | #708090 | ||
slategrey | #708090 | ||
snow | #fffafa | ||
springgreen | #00ff7f | ||
steelblue | #4682b4 | ||
tan | #d2b48c | ||
thistle | #d8bfd8 | ||
tomato | #ff6347 | ||
turquoise | #40e0d0 | ||
violet | #ee82ee | ||
wheat | #f5deb3 | ||
whitesmoke | #f5f5f5 | ||
yellowgreen | #9acd32 | ||
rebeccapurple | #663399 |
Input Types
TYPE | PREVIEW | TYPE | PREVIEW |
---|---|---|---|
button | password | ||
checkbox | radio | ||
color | range | ||
date | reset | ||
datetime-local | search | ||
submit | |||
file | tel | ||
hidden | text | ||
image | time | ||
month | url | ||
number | week |