Skip to main content

Command Palette

Search for a command to run...

A Beginner’s Guide to Writing Faster Markup

Published
3 min read

If you are new to HTML, you’ve probably felt this already:

Typing the same tags again and again feels slow and boring.

<div>
  <h1></h1>
  <p></p>
</div>

Now imagine writing this many times in one project.

This is where Emmet becomes your best friend.


What is Emmet? (Very Simple Explanation)

Emmet is a shortcut language for writing HTML faster.

Instead of typing full HTML code, you write small abbreviations, and your editor expands them into complete HTML.

Think of Emmet like:

  • Autocomplete on steroids

  • A shorthand version of HTML

You type less, but get more.

Why Emmet is Useful for HTML Beginners

Emmet helps beginners because it:

  • Saves time

  • Reduces typing mistakes

  • Helps you focus on structure

  • Makes HTML practice less tiring

You don’t need to remember everything — Emmet does the boring work for you.

And yes, Emmet is optional, but once you use it, you won’t want to stop.


How Emmet Works Inside Code Editors

Emmet works inside code editors, not browsers.

Most popular editors support Emmet by default:

  • VS Code (recommended)

  • Sublime Text

  • Atom

How it works:

  1. You type an Emmet abbreviation

  2. Press Tab or Enter

  3. It expands into HTML

That’s it.

Basic Emmet Syntax (Your First Shortcut)

Let’s start with the simplest example.

Example: Creating a paragraph

Emmet abbreviation

p

Expanded HTML

<p></p>

Just type p and press Tab.

That’s your first Emmet

Creating HTML Elements Using Emmet

You can create any HTML tag the same way.

Example:

Emmet

h1

HTML

<h1></h1>

Example:

Emmet

div

HTML

<div></div>

Simple and clean.


Adding Classes, IDs, and Attributes

Emmet makes this very easy.

Class (.)

Emmet

div.container

HTML

<div class="container"></div>

ID (#)

Emmet

section#hero

HTML

<section id="hero"></section>

Attributes ([])

Emmet

img[src="image.jpg" alt="banner"]

HTML

<img src="image.jpg" alt="banner">

No more typing long tags manually 😌


Creating Nested Elements

HTML often has elements inside elements.
Emmet handles this beautifully.

Example: Parent > Child

Emmet

div>p

HTML

<div>
  <p></p>
</div>

Multiple nested elements

Emmet

div>h1+p

HTML

<div>
  <h1></h1>
  <p></p>
</div>

Repeating Elements Using Multiplication

This is one of the most loved Emmet features.

Example: List items

Emmet

li*3

HTML

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

With parent element

Emmet

ul>li*4

HTML

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

Generating Full HTML Boilerplate

This one feels like magic ✨

Emmet:

!

(or)

html:5

HTML:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>

</body>
</html>

In one second, your full HTML structure is ready.


Emmet is Optional, But Powerful

You can write HTML without Emmet — that’s totally fine.

But Emmet:

  • Speeds up your workflow

  • Makes practice enjoyable

  • Helps you focus on layout and structure

Start small.
Use it daily.
Soon it will feel natural.


Final Thoughts

Emmet doesn’t replace HTML.
It helps you write HTML faster and smarter.

If you remember just this:

  • Emmet = shortcuts for HTML

  • Press Tab to expand

  • Practice a little every day