Logo
  • PHP
    • HipHop / HHVM
    • Modern PHP
    • PHPStorm
    • LAMP
    • Laravel
    • Composer
    • PDO
  • JavaScript
    • node.js
    • AngularJS
  • CSS
    • SASS
    • “CSS4” (CSS level 4)
  • HTML
  • Git
  • LAMP
  • Vagrant
  • UI / UX
  • Architecture of …
  • Off-Topic
With ♥ from Berlin
November 15, 2013
Chris
CSS, HTML5, Local Development, PHPStorm
0

Increase your HTML / CSS coding speed with EMMET

PreviousNext

Codeninja.com just published a very interesting article about the excellent free code-completion/code-generation tool EMMET, which allows you to create huge HTML or CSS constructs by simple typing some characters. Let’s have a look:

When using EMMET (usually a seamless integrated plugin in your favourite IDE/coding tool) you can simply type:

ul>li*5

and press TAB (or ENTER or whatever is defined as the EMMET-action-key) to create something like

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

Cool ! But that’s just VERY basic. You can put variables and “counter values” in there, like:

ul#nav>li*5>a{Page $}

which will create

<ul id="nav">
    <li><a href="">Page 1</a></li>
    <li><a href="">Page 2</a></li>
    <li><a href="">Page 3</a></li>
    <li><a href="">Page 4</a></li>
    <li><a href="">Page 5</a></li>
</ul>

Create a full font-face construct with

@f+

When editing the result, EMMET will automatically sync the values of the “Filename”:

@font-face { 
    font-family: 'FontName'; 
    src: url('FileName.eot'); 
    src: url('FileName.eot?#iefix') 
    format('embedded-opentype'), 
    url('FileName.woff') format('woff'), 
    url('FileName.ttf') format('truetype'), 
    url('FileName.svg#FontName') 
    format('svg'); 
    font-style: normal; 
    font-weight: normal; 
}

 

There are hundreds of commands like that, and you can create your own. This comes extremely handy when writing a lot of CSS, especially when using a lot of browser vendor fixes, like -webkit… !

PHPStorm users: EMMET is integrated into PHPStorm 6/7 by default. Interesting side-fact: There’s a code-completion for PHP too, built-in into PHPStorm, but more on that in another article.

List of EMMET commands:

http://docs.emmet.io/cheat-sheet/

List of supported IDEs and coding tools

http://emmet.io/download/

Demo Video

 

This article was written quite a while ago (10 years), please keep this in mind when using the information written here. Links, code and commands might be outdated or broken.

Random articles

  • PHPStorm: 42 Tips and Tricks (47min video talk by Mikhail Vink at Dutch PHP Conference 2015)PHPStorm: 42 Tips and Tricks (47min video talk by Mikhail Vink at Dutch PHP Conference 2015)
  • What’s new in PHPStorm 9What’s new in PHPStorm 9
  • Get Github’s code colors in PHPStorm (2014 style)Get Github’s code colors in PHPStorm (2014 style)
  • When PHPStorm’s cache eats up your harddisk spaceWhen PHPStorm’s cache eats up your harddisk space
  • PHPStorm 8 has just been releasedPHPStorm 8 has just been released
  • Get Github’s syntax highlighting colors in PHPStormGet Github’s syntax highlighting colors in PHPStorm
  • A perfect video tutorial to get started with xdebug in PHPStormA perfect video tutorial to get started with xdebug in PHPStorm
  • Sitepoint asks for your favourite PHP IDE – take part!Sitepoint asks for your favourite PHP IDE – take part!
  • Killer-feature in PHPStorm: Search everywhereKiller-feature in PHPStorm: Search everywhere
code completionemmetPHPStormzen coding
Share this

Leave A Comment Cancel reply

A collection of beautiful ajax loaders / spinners in pure .svg / CSS

No images used, pure svg/css and scaleable. Bookmark now! Brent Jackson‘s ajax spinner / loader library on the project’s demo

php

How to install PHP curl extension (in 5 seconds)

It’s a common wordpress problem: PHP’s curl extension is not installed! No need to mess around in config files etc,

O’Reilly’s Learning JavaScript Design Patterns by Addy Osmani for free

Addy Osmani has published his excellent book Learning JavaScript Design Patterns for free! You can read the entire book including

logo-internet-explorer

How to professionally test on old Internet Explorer versions

If you have (or want) to test your websites and applications on older versions of Internet Explorer, then there’s a

anti block adblock

Show ads to ad-blockering visitors – with PageFair.com

Interesting news on the dramatically decreasing web ad market: There’s a new service called PageFair that does basically exactly what

hack-php

Wow! Facebook devs have rewritten and fixed PHP, releasing it as new language called “Hack” today

Exciting stuff is happening: Some years ago Facebook has released an early preview of HipHop, a virtual machine that precompiles

php

How to install/setup latest version of PHP 5.5 on Debian Wheezy 7.0/7.1/7.2 (and how to fix the GPG key error)

Please note: This works fine. But this package will also upgrade your apache to version 2.4 which has different config

css3-chrome-font

Google rolls out Chrome 37, finally fixes horrible font-rendering

Google has rolled out Chrome 37 today, a legendary milestone that fixes one of the most annoying “bugs” in frontend

sass laravel

Extremely easy SASS in Laravel (with pure PHP)

Working with SASS is awesome: it reduces your workload dramatically, makes web projects much cleaner, DRYs your code, adds awesome

Going node.js at Netflix (Slides by Micah R of Netflix)

It’s awesome how node.js takes over the absolute AAA-level corporate world. Note that node.js is still an early alpha product

1/4

Categories

Search

laracon-2014-eu-amsterdam
Laracon 2013 – Kapil Verma: Engineering Complex Applications with Laravel 4 (40min video)
Material Design – How Google designed Android L (7min video)
DigitalOcean coupon voucher 50
Only today: $50 coupon for DigitalOcean SSD VPS / hosting
bitdeli git github stats
Get visitor stats for your GitHub repo with BitDeli
offf-2014
Europeans: Get ready for OFFF conference / festival in Barcelona, May 2014
[Link] Improving Smashing Magazine’s Performance: A Case Study
php
PHP 5.6.0 RC1 is available
[Link] Redesigning SoundCloud by Evan Simoni
node.js
PayPal drops Java, goes node.js / JavaScript
Support FLARUM, the future of PHP forum scripts (with some dollars on Kickstarter)
set up a local virtual machine for development with vagrant and puphpet / puppet (and ubuntu, linux, php, apache, mysql)
A list of downloadable Vagrant boxes (CentOS 5.9 / 6.4, Ubuntu 12 / 13, Debian 6 / 7 / 7.1 / 7.2)
php
How to install PHP curl extension (in 5 seconds)
phpstorm-github-code-color-syntax-theme
Get Github’s code colors in PHPStorm (2014 style)
java vs php
Switching from Java to PHP. Seriously. A very interesting and pre-judice-free talk with Ph.D. Aris Zakinthinos
How to hack time (KUNG FURY promo campaign)

Tags

apache bash centos composer conference coupon CSS debian fonts framework git GitHub hack HHVM HipHop HTML HTML5 IDE JavaScript JS LAMP laravel linux mod_rewrite MVC MySQL Nginx optimization PHP PHP 5.5 PHP 5.6 phpmyadmin PHPStorm security server SSD Ubuntu UI UX vagrant video virtual machine voucher VPS wordpress
Side-Project: Wordle-Solver:
www.wordle-helper.info

Pages

  • Privacy Policy
 
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT