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
Comments Off on Increase your HTML / CSS coding speed with EMMET

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

 

code completionemmetPHPStormzen coding
Share this
hearthbleed-ssl-bug

The SSL Heartbleed bug explained in 30 seconds

Another excellent comic by xkcd (a site that publishes dev/op/web-related comics, usually nailing things right to the head): This time

shadow dom

Crossbrowser-safe HTML5 video (IE6+) with a few lines of code and just one .mp4 video file

No time to read the full article ? Get the code directly here on GitHub: panique/html5-video. Publishing a video on

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

(Links) How to fix an extremely slow Symfony inside a Vagrant box

When you work with Vagrant (if not – try it!) on a Windows or Mac machine (which is an excellent

Disappointed by Watch Dogs’s graphics ? See how it looks with unlocked, hidden settings. Awesome!

When you are interested in 3D and game graphics in general, you probably stumbled upon these excellent and extremely good-looking

[Link] Improving Smashing Magazine’s Performance: A Case Study

The title says it all: A very interesting guide through the optimization process on one of the largest blogs in

digitalocean coupon

Free $10 coupon for DigitalOcean SSD cloud VPS hosting

DigitalOcean puts out another coupon, this time for free $10 with the code SSD2014. The company offers small and big

Perfect HTML email templates for perfect HTML emails (outlook!) with INK

The people behind FOUNDATION, the excellent responsive frontend framework, have just released a set of highly professional, perfectly compatible HTML

hiphop php

HipHop VM reaches 100% green Unit Tests in Laravel, Drupal, Slim, CodeIgniter etc.

In September 2013 the PHP HipHop VM dev team wrote a very interesting article [1] about failing Unit Tests of

Support FLARUM, the future of PHP forum scripts (with some dollars on Kickstarter)

PHP forum scripts are horrible, let’s face it. Nearly everything that’s available is hard to install, hard to handle, hard

1/4

Categories

Search

phpstorm 7.0 php
PHPStorm 7 has been released!
html6
Is this the first HTML6 specification?
Quick fix for 404 error in WordPress category / tag page
pdo-debug
Debug PDO with this one-line function. Yeah!
This is an experimental advertisement
atomic-design
An introduction into Atomic Design, a super-clean way to style web applications
Joshua Davis – my hero of Flash – in two excellent interviews (audio, video)
organizing css
Jonathan Snook – CSS is a Mess – How to organize CSS in big projects (54min video talk)
How to hack time (KUNG FURY promo campaign)
Going node.js at Netflix (Slides by Micah R of Netflix)
vagrant
Generate Vagrant boxes with Laravel, HipHop, Nginx, WordPress, MySQL, MariaDB, MongoDB, RabbitMQ etc. with one click
Frontend Ops Conf 2014 – Sarah Goff-Dupont: Git, Continuous Integration and Making It Pretty (31min video)
css
How to center a div vertically and horizontally (modern methods, without fixed size!)
Interesting stats on SONY’s hacked passwords
js javascript
[video] Netflix JavaScript Talks about ECMAScript 7: The Evolution of JavaScript

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