--- title: Emmet date: 2020-12-14 18:28:43 background: bg-[#95c844] tags: - snippets - coding - html - css - abbr categories: - Toolkit intro: | [Emmet](https://emmet.io/) is a web-developer’s toolkit for boosting HTML & CSS code writing, which allows you to write large HTML code blocks at speed of light using well-known CSS selectors. plugins: - copyCode --- Emmet Syntax --------------- ### Getting started Let us start to improve your development to the speed of light. - [Emmet in Visual Studio Code](https://code.visualstudio.com/docs/editor/emmet) _(code.visualstudio.com)_ - [Emmet 2 for Sublime Text](https://github.com/emmetio/sublime-text-plugin) _(github.com)_ - [Emmet for Coda](https://emmet.io/download/coda/) _(emmet.io)_ - [Emmet for Atom](https://github.com/emmetio/emmet-atom#readme) _(github.com)_ ### Multiplication: * ul>li*5 ```html ``` ### Child: > `nav>ul>li` ```html ``` ### Custom attributes {.col-span-2} p[title="Hello world"] ```html

``` td[rowspan=2 colspan=3 title] ```html ``` [a='value1' b="value2"] ```html
``` ### Text: {} a{Click me} ```html Click me ``` p>{Click }+a{here}+{ to continue} ```html {.wrap}

Click here to continue

``` ### ID and CLASS attributes {.row-span-2} `#header` ```html ``` .title ```html
``` form#search.wide ```html ``` p.class1.class2.class3 ```html

``` ### Implicit tag names {.row-span-2} .class ```html
``` em>.class ```html ``` ul>.class ```html ``` table>.row>.col ```html
``` ### Sibling: + div+p+bq ```html

``` ### Climb-up: ^ div+div>p>span+em^bq ```html

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

``` ### Grouping: () div>(header>ul>li*2>a)+footer>p ```html
``` (div>dl>(dt+dd)*4)+footer>p ```html
``` ### $ {.row-span-2} ul>li.item$*3 ```html ``` h$[title=item$]{Header $}*3 ```html

Header 1

Header 2

Header 3

``` ul>li.item$$$*3 ```html ``` ul>li.item$@-*3 ```html ``` ul>li.item$@2*3 ```html ``` Also see {.cols-1} -------- * [Emmet Cheat sheet](https://docs.emmet.io/cheat-sheet/) _(docs.emmet.io)_