DEV Community

Cover image for Emmet Cheat Sheet
Imam Ahasan
Imam Ahasan

Posted on

Emmet Cheat Sheet

Child: >

nav>ul>li

<nav>
    <ul>
        <li></li>
    </ul>
</nav>
Enter fullscreen mode Exit fullscreen mode

Sibling: +

div+p+bq

<div></div>
<p></p>
<blockquote></blockquote>
Enter fullscreen mode Exit fullscreen mode

Climb-up: ^

div+div>p>span+em^bq

<div></div>
<div>
    <p><span></span><em></em></p>
    <blockquote></blockquote>
</div>
Enter fullscreen mode Exit fullscreen mode

div+div>p>span+em^^bq

<div></div>
<div>
    <p><span></span><em></em></p>
</div>
<blockquote></blockquote>
Enter fullscreen mode Exit fullscreen mode

Grouping: ()

div>(header>ul>li*2>a)+footer>p

<div>
    <header>
        <ul>
            <li><a href=""></a></li>
            <li><a href=""></a></li>
        </ul>
    </header>
    <footer>
        <p></p>
    </footer>
</div>
Enter fullscreen mode Exit fullscreen mode

(div>dl>(dt+dd)*3)+footer>p

<div>
    <dl>
        <dt></dt> 
        <dd></dd> 
        <dt></dt> 
        <dd></dd> 
        <dt></dt> 
        <dd></dd>
    </dl> 
</div>
<footer>
    <p></p>
</footer>
Enter fullscreen mode Exit fullscreen mode

Multiplication: *

ul>li*5

<ul>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
</ul>
Enter fullscreen mode Exit fullscreen mode

Naming and numbering: $

ul>li.sample$*5

<ul>
    <li class="sample1"></li>
    <li class="sample2"></li>
    <li class="sample3"></li>
    <li class="sample4"></li>
    <li class="sample5"></li>
</ul>
Enter fullscreen mode Exit fullscreen mode

h$[title=topic$]{Headline $}*3

<h1 title="topic1">Headline 1</h1>
<h2 title="topic2">Headline 2</h2>
<h3 title="topic3">Headline 3</h3>
Enter fullscreen mode Exit fullscreen mode

ul>li.item$$$*5

<ul>
    <li class="item001"></li>
    <li class="item002"></li>
    <li class="item003"></li>
    <li class="item004"></li>
    <li class="item005"></li>
</ul>
Enter fullscreen mode Exit fullscreen mode

ul>li.item$@-*5

<ul>
    <li class="item5"></li>
    <li class="item4"></li>
    <li class="item3"></li>
    <li class="item2"></li>
    <li class="item1"></li>
</ul>
Enter fullscreen mode Exit fullscreen mode

ul>li.item$@3*5

<ul>
    <li class="item3"></li>
    <li class="item4"></li>
    <li class="item5"></li>
    <li class="item6"></li>
    <li class="item7"></li>
</ul>
Enter fullscreen mode Exit fullscreen mode

ID and CLASS attributes

'#header'

<div id="header"></div>
Enter fullscreen mode Exit fullscreen mode

.title

<div class="title"></div>
Enter fullscreen mode Exit fullscreen mode

form#search.wide

<form action="" id="search" class="wide"></form>
Enter fullscreen mode Exit fullscreen mode

p.class1.class2.class3

<p class="class1 class2 class3"></p>
Enter fullscreen mode Exit fullscreen mode

Custom attributes

p[title="Hello world"]

<p title="Hello world"></p>
Enter fullscreen mode Exit fullscreen mode

td[rowspan=2 colspan=3 title]

<td rowspan="2" colspan="3" title=""></td>
Enter fullscreen mode Exit fullscreen mode

[a=‘value1‘ b="value2"]

<div a="value1" b="value2"></div>
Enter fullscreen mode Exit fullscreen mode

Text: {}

a{Click me}

<a href="">Click me</a>
Enter fullscreen mode Exit fullscreen mode

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

<p>Click <a href="">here</a> to continue</p>
Enter fullscreen mode Exit fullscreen mode

Implicit tag names

em>.class

<em><span class="class"></span></em>
Enter fullscreen mode Exit fullscreen mode

ul>.class

<ul>
    <li class="class"></li>
</ul>
Enter fullscreen mode Exit fullscreen mode

table>.row>.col

<table>
    <tr class="row">
        <td class="col"></td>
    </tr>
</table>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)