HTML abbreviations, nesting, attributes, CSS shortcuts
HTML Abbreviations
Element Shortcuts
div
Create
p
Create
h1
Create
a
Create
img
Create
input
Create
btn
Create
link:css
Link tag for CSS stylesheet
HTML Boilerplate
! → full HTML5 boilerplate
doc → HTML5 doctype only
Implicit Tags
.class
Resolves to
ul>.item
Child resolves to
table>.row
Child resolves to
select>.opt
Child resolves to
Nesting
Nesting Operators
>
Child element
+
Sibling element
^
Climb up one level
^^
Climb up two levels
Nesting Examples
div>ul>li → nested child elements
div+p+footer → sibling elements
div>p>span^h2 → climb up: h2 is sibling of p
div>p>span^^h2 → climb up twice: h2 sibling of div
Grouping
Parentheses Grouping
div>(header>nav)+main+footer
→ groups header>nav as a unit
(div>h2+p)*3
→ repeat grouped structure 3 times
Complex Layout
.container>(header>h1+nav>ul>li*3)+main+footer
→ full page layout skeleton
Multiplication
Repeat Operator
li*5
Create 5
elements
div>p*3
Div with 3 child paragraphs
ul>li*4>a
List with 4 items, each containing a link
tr>td*4
Table row with 4 cells
Multiplication Examples
ul>li.item*5 → 5 list items with class
table>tr*3>td*4 → 3x4 table grid
.row>.col*3>p{Content} → 3-column row with text