DEV Community

Jon Stødle
Jon Stødle

Posted on • Originally published at blog.jonstodle.com on

3

Have you met Emmet?

Most popular code editor today have support for Emmet snippets and if you haven't started using them yet. Your life is about to get a bit easier.

You might have come across some code snippets while using your code editor of choice. The snippets let's you insert small blocks of code with the help of a simple shortcut. Emmet is this idea on steroids.

Emmet let's you use CSS syntax to define multiple parts of HTML in one simple go. Type what elements you want, what ids they should have, what classes should be included and what the content will be. Take a look at this for example:

Creating a button with id, class and content

You can get pretty advanced with this. It supports adding child elements, content and much more. You can even multiply the expression to create multiple identical elements:

Creating multiple elements in one go

There's a lot to bite into here, so I suggest heading over to the documentation of the project to see what is possible.

It's really adictive once you get used to it. The demonstrations above were recorded in Visual Studio Code where Emmet snippets are inlcuded out of the box for HTML files. A lot of editors come with Emmet included and there are loads of plugins for those that don't support it out of the box.

This is one really neat feature just waiting to be used!

Happy coding!

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay