Emmet Part 1 - Basics

codeSTACKr - May 10 '20 - - Dev Community

Emmet is a FREE plugin for many popular code editors which helps you write HTML and CSS fast! Emmet has support for many editors, including Sublime Text, Atom, Visual Studio Code, and many others. VS Code comes with Emmet pre-installed.

When you start typing an Emmet abbreviation, you will see the abbreviation displayed in the suggestion list.

Alt Text

In this post we cover the following topics:
πŸ“Œ Tags
πŸ“Œ Siblings
πŸ“Œ Children
πŸ“Œ Class
πŸ“Œ Id
πŸ“Œ Id & Class
πŸ“Œ Content
πŸ“Œ Multiplyβ €β €β €β €β €β €

Part 2 coming soon!

Tags

Basic abbreviations can be used to quickly create HTML tags.

  • div

    <div></div>
    
  • p

    <p></p>
    
  • h1

    <h1></h1>
    

Siblings

To create a set of HTML tags as siblings just use + in between each abbreviation.

  • hdr+sect+ftr

    <header></header>
    <section></section>
    <footer></footer>
    

Children

Child elements can be created by using > in between each abbreviation.

  • sect>ul>li

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

Class

In order to create elements with classes just append the class to the abbreviation using .

  • h1.center

    <h1 class="center"></h1>
    

Id

To add an Id to an element, append the Id to the abbreviation using #

  • h1#header

    <h1 id="header"></h1>
    

Id & Class

You can include multiple attributes on an element abbreviation.

  • h1#header.center

    <h1 id="header" class="center"></h1>
    

Content

Text content of an element can be included by wrapping the content with { }

  • p{This is a paragraph.}

    <p>This is a paragraph.</p>
    

Multiply

We can create multiple elements by multiplying them using *

  • ul>li*4

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

Part 2 coming very soon! Check out the full video on my YouTube channel.

Thanks for reading!

Say Hello! Instagram | Twitter | YouTube

. . . . . . . . . . . . .
Terabox Video Player