HTML5HTMLWeb DevelopmentwebdevCohort2026ChaiCodeChaiaurcodeChaiCohort

Emmet for HTML: A Beginner’s Guide to Writing Faster Markup

Learn how Emmet can revolutionize the way you write HTML, speeding up your workflow with shortcuts and automation tricks

Kenil Patel
Kenil PatelFull Stack Engineer
Emmet for HTML: A Beginner’s Guide to Writing Faster Markup

Have you ever felt that writing HTML is a bit... slow? Opening a tag, typing the attributes, closing the tag, and then repeating the process for every single element can feel like a chore. For a beginner, this "manual labor" often takes away the focus from learning the actual structure of a webpage.

Enter Emmet—the secret weapon used by professional developers to turn minutes of typing into seconds of magic.


What is Emmet? (The Simple Definition)

In very simple terms, Emmet is a shorthand tool for web developers. It allows you to type short "abbreviations" (like codes) that instantly expand into full HTML markup.

If you use VS Code, Emmet is already built-in! You don't need to install anything; you just need to learn the "language" of shortcuts.


Why Every Beginner Should Use Emmet

  1. Speed: You can build a complex layout in a few keystrokes.

  2. No Typos: Emmet ensures your tags are always closed and nested correctly.

  3. Standardized: It helps you follow proper HTML structure effortlessly.


1. Creating Basic Elements

Instead of typing out the full brackets, just type the name of the tag and hit the Tab or Enter key.

  • Type: h1 → Result: <h1></h1>

  • Type: section → Result: <section></section>

2. Adding Classes and IDs

Just like in CSS, we use a dot (.) for classes and a hash (#) for IDs. This is the most common pattern you will use daily.

  • Type: p.description → Result: <p class="description"></p>

  • Type: div#main-container → Result: <div id="main-container"></div>

3. Creating Nested Structures

Want to put one element inside another? Use the Greater Than (>) symbol. This represents a parent-child relationship.

  • Type: div>ul>li

  • Result:

HTML

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

4. Multiplication: Repeating Elements

Building a navigation menu or a list? Don't copy-paste! Use the asterisk (*) symbol followed by a number to repeat an element.

  • Type: ul>li*5

  • Result:

HTML

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

5. Adding Attributes

If you need to add specific attributes (like a link for an anchor tag or a source for an image), use square brackets [ ].


The "Magic" Shortcut: Full HTML Boilerplate

Every HTML file needs a standard structure (the <!DOCTYPE>, <html>, <head>, and <body> tags). Instead of writing it manually or searching for a template:

  1. Open a new .html file.

  2. Type an exclamation mark (!) and hit Tab.

  3. Boom! Your entire HTML boilerplate is ready.


How to Practice

The best way to learn Emmet is to stop writing HTML the "old way." Every time you need a tag, think: "How would I do this with Emmet?"

Quick Reference Table

Desired ResultEmmet Shortcut
Any Tagtagname
Class.name
ID#name
Child Element>
Multiply*
Boilerplate!

Conclusion:

Emmet is entirely optional, but once you start using it, there is no going back. It makes the process of writing code feel less like "typing" and more like "building." Give these shortcuts a try in your next Web Dev Cohort assignment!