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

Search for a command to run...

No comments yet. Be the first to comment.
You open WhatsApp, type a message, and hit send. A single grey tick appears. You're on a train with no signal, but the message went through anyway. Or did it? That single tick is the beginning of a su

You record a Reel, add a song, trim it, and then close the app before posting. When you reopen Instagram, the draft is right there waiting. Nothing was lost. That experience feels simple. The system b

If you have built a React Native app, you have felt the pain of navigation setup. It is easy to get wrong and hard to keep clean as apps grow. This article explains what routing means, why it matters,

Modern apps are not just a pile of screens. They are a living system of features, data flows, offline behavior, and performance constraints. If you have only shipped small apps, the jump to something

Your application has user accounts. Some routes should only be accessible to logged-in users. How do you protect routes and verify that a request actually comes from who they claim to be? JWT (JSON We

Ashish's Blog
57 posts
Imagine typing just a few characters and watching them magically expand into complete, properly structured HTML code. That's exactly what Emmet does—and once you start using it, you'll wonder how you ever coded without it.
Let's be honest: writing HTML by hand can feel repetitive and slow. Consider this simple navigation menu:
<nav>
<ul>
<li><a href="">Home</a></li>
<li><a href="">About</a></li>
<li><a href="">Services</a></li>
<li><a href="">Contact</a></li>
</ul>
</nav>
That's a lot of typing! You have to:
Type opening and closing tags
Remember to close every tag you open
Manually create repeated structures
Add classes and IDs one by one
What if you could generate all of that with just one line? That's where Emmet comes in.
Emmet is a shortcut language that lets you write HTML (and CSS) much faster. Think of it as a super-compressed way of writing code that automatically expands into full markup.
Instead of typing:
<div class="container"></div>
You simply type:
div.container
Then press Tab or Enter, and Emmet expands it into the full HTML for you.
Emmet is like autocorrect for code—but instead of fixing typos, it expands abbreviations into complete HTML structures.
You might be thinking: "I'm just learning HTML. Shouldn't I write everything manually to understand it better?"
That's a fair question, but here's why Emmet is actually great for beginners:
Saves time: Spend less time typing and more time learning
Reduces errors: No more forgetting to close tags
Teaches HTML structure: Emmet's syntax mirrors HTML's hierarchy
Builds confidence: Creating complex layouts becomes less intimidating
Industry standard: Professional developers use Emmet daily
The key: Learn HTML basics first, then add Emmet to speed things up.
Emmet is built into most modern code editors, including:
Visual Studio Code (VS Code)
Sublime Text
Atom
Brackets
WebStorm
You Type: Press Tab: Result:
─────────────────────────────────────────────────────────
div ─────────→ <div></div>
p.intro ─────────→ <p class="intro"></p>
ul>li*3 ─────────→ <ul>
<li></li>
<li></li>
<li></li>
</ul>
| Emmet | Result |
div | <div></div> |
p | <p></p> |
h1 | <h1></h1> |
span | <span></span> |
Emmet: p{Hello World}
Result: <p>Hello World</p>
Emmet: div.container
Result: <div class="container"></div>
Emmet: div#header
Result: <div id="header"></div>
Emmet: div#main.container.fluid
Result: <div id="main" class="container fluid"></div>
Emmet: a[href="https://google.com"]
Result: <a href="https://google.com"></a>
Emmet: div>header>h1
Result:
<div>
<header>
<h1></h1>
</header>
</div>
Emmet: ul>li*3
Result:
<ul>
<li></li>
<li></li>
<li></li>
</ul>
!
Expands to:
<!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>
Emmet is a shortcut language that expands abbreviations into HTML
It's built into VS Code and most modern editors
Use . for classes, # for IDs, and [] for attributes
> creates child elements, + creates siblings
* multiplies elements, $ adds numbering
Type ! and press Tab for instant HTML5 boilerplate
Happy coding!