Emmet Cheatsheet - Emmet Abbreviation & Syntax Reference
For hand-writing HTML in an editor like VSCode. Emmet expands one short abbreviation into a full nested structure, which is a large speed gain if you are not using a GUI page builder. By the end you can type an outline like a nav with nested items and produce complete markup, generate repetitive loops and attributes, and apply CSS shorthands without looking them up.
HTML Basics 8
! or html:5Expand HTML5 document skeleton
div#app<div id="app"></div>
div.container<div class="container"></div>
ul>li*33 li elements under ul
ul>li.item$*3li with incrementing class: item1, item2, item3
p>span^divspan inside p; div is sibling of p (climb-up)
a[href="#" title="link"]a tag with attributes
img<img src="" alt="">
Common HTML Structures 8
form:postform with method="post"
input:text<input type="text">
input:email<input type="email">
btn:submit<button type="submit"></button>
select>option*33 options under select
table>tr^tr>td*3Two-row table, 3 cells in second row
lorem10Generate 10-word placeholder text
lorem-cnGenerate Chinese placeholder (plugin required)
CSS Shorthand 18
w100width: 100px
w100pwidth: 100%
h50height: 50px
m10margin: 10px
m10-20margin: 10px 20px
p10-20-30padding: 10px 20px 30px
bgc#333background-color: #333
c#fffcolor: #fff
fz16font-size: 16px
fw700font-weight: 700
d:fdisplay: flex
d:gdisplay: grid
jc:cjustify-content: center
ai:calign-items: center
pos:aposition: absolute
t0 r0 b0 l0top/right/bottom/left: 0
bd1-s-#cccborder: 1px solid #ccc
br8border-radius: 8px
Nesting & Loops 5
div>ul>li*5>a{Item $}Nesting + loop + text interpolation
div+p+bqSibling nodes (+)
{Hello}Text node
${Item}Numbered text
(#header>ul>li*2>a)+footer>pGroup () combines multiple structures
Tips
- VS Code ships with Emmet built in — press Tab to expand abbreviations in HTML, CSS, JSX and Pug files.
- $ is an auto-incrementing placeholder; $$ zero-pads (01, 02) and $@- reverses the order.
- CSS shorthands join multiple values with a hyphen, e.g. m10-20 expands to margin: 10px 20px.
Official References
Each command links to its official documentation below, so you can verify the latest usage and read deeper.
Maintained by LaoHand
Publicly updated on Jul 21, 2026, continuously proofread against official docs.
Contact Us
Wrong command or description? Send us corrections, business inquiries or product feedback by email.
Contact Us