This page is not available in every language. Missing translations are disabled in the language selector.

Quick reference

Emmet HTML/CSS Abbreviations Cheat Sheet

A quick reference guide for Emmet abbreviations: child elements, siblings, climb-up, multiplication, grouping, ID/classes, item numbering, and text nodes.

· Published

Emmet is an essential developer toolkit for rapidly writing HTML, XML, and CSS via dynamic CSS-like abbreviation expansions.

Structural Hierarchy Syntax

Child Element (>)

nav>ul>li expands to:

<nav>
  <ul>
    <li></li>
  </ul>
</nav>

Sibling Element (+)

div+p+bq expands to:

<div></div>
<p></p>
<blockquote></blockquote>

Climb-up (^)

div+div>p>span+em^^bq expands to:

<div></div>
<div>
  <p><span></span><em></em></p>
</div>
<blockquote></blockquote>

Multiplication (*)

ul>li*3 expands to:

<ul>
  <li></li>
  <li></li>
  <li></li>
</ul>

Grouping (())

div>(header>ul>li*2)+footer>p expands to:

<div>
  <header>
    <ul>
      <li></li>
      <li></li>
    </ul>
  </header>
  <footer>
    <p></p>
  </footer>
</div>

Attributes & Text Syntax

Classes & IDs (., #)

header#main-header.navbar.fixed expands to:

<header id="main-header" class="navbar fixed"></header>

Custom HTML Attributes ([])

a[title="Home" target="_blank"] expands to:

<a href="" title="Home" target="_blank"></a>

Item Numbering ($)

ul>li.item$*3 expands to:

<ul>
  <li class="item1"></li>
  <li class="item2"></li>
  <li class="item3"></li>
</ul>

Use multiple $ characters for zero-padding (e.g. item$$ → item01, item02).

Text Nodes ({})

a{Click Here} expands to:

<a href="">Click Here</a>

p>{Click }+a{here}+{ to continue} expands to:

<p>Click <a href="">here</a> to continue</p>

Common HTML5 Boilerplate

Type ! or html:5 and press Tab:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>

</body>
</html>

Related topics