Normally we use CSS selectors to find and tear apart HTML. Sergey Chikuyonok's jujitsu move is to do the opposite. With Zen Coding you take a CSS selector like this:

HTML:
  1.  
  2. html:xt>div#header>div#logo+ul#nav>li.item-$*5>a
  3.  

and it generates an HTML structure like this:

HTML:
  1.  
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  4.         <title></title>
  5.         <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
  6. </head>
  7.         <div id="header">
  8.                 <div id="logo"></div>
  9.                 <ul id="nav">
  10.                         <li class="item-1"><a href=""></a></li>
  11.                         <li class="item-2"><a href=""></a></li>
  12.                         <li class="item-3"><a href=""></a></li>
  13.                         <li class="item-4"><a href=""></a></li>
  14.                         <li class="item-5"><a href=""></a></li>
  15.                 </ul>
  16.         </div>
  17. </body>
  18. </html>
  19.  

You can check out a demo or try out support in various editors (Aptana to TextMate).

Now I want to create a Bespin plugin to do this too!


Related News :