<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Zen | 酷 壳 - CoolShell</title>
	<atom:link href="https://coolshell.cn/tag/zen/feed" rel="self" type="application/rss+xml" />
	<link>https://coolshell.cn</link>
	<description>享受编程和技术所带来的快乐 - Coding Your Ambition</description>
	<lastBuildDate>Sun, 09 May 2010 16:40:06 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2</generator>
	<item>
		<title>写HTML和CSS的新方法</title>
		<link>https://coolshell.cn/articles/2406.html</link>
					<comments>https://coolshell.cn/articles/2406.html#comments</comments>
		
		<dc:creator><![CDATA[陈皓]]></dc:creator>
		<pubDate>Tue, 11 May 2010 00:18:19 +0000</pubDate>
				<category><![CDATA[Web开发]]></category>
		<category><![CDATA[杂项资源]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Zen]]></category>
		<guid isPermaLink="false">http://coolshell.cn/?p=2406</guid>

					<description><![CDATA[<p>Zen Coding 一个用来简化编写 HTML，XML， XSL （或是其它一些诸如此类格式的编辑器）。其主要是用一种缩写方式的语法来书写大量重复和无味的HT...</p>
<p class="read-more"><a class="btn btn-default" href="https://coolshell.cn/articles/2406.html"> Read More<span class="screen-reader-text">  Read More</span></a></p>
The post <a href="https://coolshell.cn/articles/2406.html">写HTML和CSS的新方法</a> first appeared on <a href="https://coolshell.cn">酷 壳 - CoolShell</a>.]]></description>
										<content:encoded><![CDATA[<p><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3415450859608158"
     crossorigin="anonymous"></script></p>
<div id="_mcePaste"><strong><a href="http://code.google.com/p/zen-coding/" target="_blank">Zen Coding</a></strong> 一个用来简化编写 HTML，XML， XSL （或是其它一些诸如此类格式的编辑器）。其主要是用一种缩写方式的语法来书写大量重复和无味的HTML，很像CSS语法。下面是一个例子：</div>
<pre>div#page&gt;div.logo+ul#navigation&gt;li*5&gt;a</pre>
<div>展开后会成为下面这个样子：</div>
<pre data-enlighter-language="html" class="EnlighterJSRAW">
&lt;div id=&quot;page&quot;&gt;
        &lt;div&gt;&lt;/div&gt;
        &lt;ul id=&quot;navigation&quot;&gt;
                &lt;li&gt;&lt;a href=&quot;&quot;&gt;&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href=&quot;&quot;&gt;&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href=&quot;&quot;&gt;&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href=&quot;&quot;&gt;&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href=&quot;&quot;&gt;&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
&lt;/div&gt;
</pre>
<div id="_mcePaste">可以看出来，#代表ID，&gt;代表下一层。</div>
<div><span id="more-2406"></span></div>
<div>如果你写下：</div>
<pre>select&gt;option#item-$*3</pre>
<div>那么将会得到：</div>
<pre data-enlighter-language="html" class="EnlighterJSRAW">

&lt;select&gt;
	&lt;option id=&quot;item-1&quot;&gt;&lt;/option&gt;
	&lt;option id=&quot;item-2&quot;&gt;&lt;/option&gt;
	&lt;option id=&quot;item-3&quot;&gt;&lt;/option&gt;
&lt;/select&gt;
</pre>
<div>看上去很不错吧。目前，其支持如下的编辑器：</div>
<div>
<p><span style="font-family: arial, sans-serif; line-height: normal;"> </span></p>
<ul>
<li><a style="color: #0000cc;" href="http://code.google.com/p/zen-coding/wiki/AptanaHowToEn">AptanaHowToEn</a></li>
<li><strong>TextMate</strong> (Mac). Available in two flavors: basic snippets (Zen HTML and Zen CSS) and full-featured plugin (ZenCoding for TextMate). <sub>Bundles &gt; Zen Coding menu item</sub></li>
<li><strong>Coda</strong> (Mac) — <a style="color: #0000cc;" rel="nofollow" href="http://github.com/sergeche/tea-for-coda/downloads">external download</a>, via <a style="color: #0000cc;" rel="nofollow" href="http://onecrayon.com/tea/">TEA for Coda</a>. <sub>Plug-ins &gt; TEA for Coda &gt; Zen Coding menu item</sub></li>
<li><strong>Espresso</strong> (Mac) — <a style="color: #0000cc;" rel="nofollow" href="http://github.com/sergeche/tea-for-espresso/downloads">external download</a>, via <a style="color: #0000cc;" rel="nofollow" href="http://onecrayon.com/tea/">TEA for Espresso</a>. Zen Coding is bundled with Espresso by default, but you should upgrade ZC to latest version. <sub>Actions &gt; HTML menu item</sub></li>
<li><strong>Komodo Edit/IDE</strong> (crossplatform) — <a style="color: #0000cc;" rel="nofollow" href="http://community.activestate.com/xpi/zen-coding">external download</a>. <sub>Tools &gt; Zen Coding menu item</sub></li>
<li><strong>Notepad++</strong> (Windows). <sub>Zen Coding menu item</sub></li>
<li><strong>PSPad</strong> (Windows). <sub>Scripts &gt; Zen Coding menu item</sub></li>
<li><strong><tt style="font-size: 13px;">&lt;textarea&gt;</tt></strong> (browser-based). See <a style="color: #0000cc;" rel="nofollow" href="http://zen-coding.ru/textarea/">online demo</a>.</li>
<li><strong>editArea</strong> (browser-based). See <a style="color: #0000cc;" rel="nofollow" href="http://zen-coding.ru/demo/">online demo</a>.</li>
</ul>
</div>
<p>还有下面这些第三方的插件：</p>
<ul>
<li><strong>Dreamweaver</strong> (Windows, Mac)</li>
<li><strong>Sublime Text</strong> (Windows)</li>
<li><strong>UltraEdit</strong> (Windows)</li>
<li><strong>TopStyle</strong> (Windows)</li>
<li><strong>GEdit</strong> (crossplatform) — <a rel="nofollow" href="http://github.com/fmarcia/zen-coding-gedit">Franck Marcia&#8217;s plugin</a>, <a rel="nofollow" href="http://github.com/mikecrittenden/zen-coding-gedit">Mike Crittenden&#8217;s plugin</a></li>
<li><strong>BBEdit/TextWrangler</strong> (Mac) — <a rel="nofollow" href="http://www.angelwatt.com/coding/zen-coding_bbedit.php">external download</a></li>
<li><strong>Visual Studio</strong> (Windows) — <a rel="nofollow" href="http://zencoding.codeplex.com/">external download</a></li>
</ul>
<p><!--



<p align="center"><a href= target=_blank><img decoding="async" src=""></a></p>





<p align="center"><img decoding="async" src="https://coolshell.cn/wp-content/uploads/2020/03/coolshell.weixin.jpg"> <img decoding="async" loading="lazy" src="https://coolshell.cn/wp-content/uploads/2020/03/coolshell.mini_.jpg" width="300" height="300"> <br />关注CoolShell微信公众账号和微信小程序</p>

 

--></p>
<div style="margin-top: 15px; font-size: 16px;color: #cc0000;">
<p align="center"><strong>（转载本站文章请注明作者和出处 <a href="https://coolshell.cn/">酷 壳 &#8211; CoolShell</a> ，请勿用于任何商业用途）</strong></p>
</div>

<div class="wp_rp_wrap  wp_rp_vertical_m" id="wp_rp_first"><div class="wp_rp_content"><h3 class="related_post_title">相关文章</h3><ul class="related_post wp_rp"><li ><a href="https://coolshell.cn/articles/17634.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2017/01/pretty-code-150x150.gif" alt="Chrome开发者工具的小技巧" width="150" height="150" /></a><a href="https://coolshell.cn/articles/17634.html" class="wp_rp_title">Chrome开发者工具的小技巧</a></li><li ><a href="https://coolshell.cn/articles/9666.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2013/05/Render-Process-150x150.jpg" alt="浏览器的渲染原理简介" width="150" height="150" /></a><a href="https://coolshell.cn/articles/9666.html" class="wp_rp_title">浏览器的渲染原理简介</a></li><li ><a href="https://coolshell.cn/articles/6840.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2012/03/css-layouts-150x150.gif" alt="CSS 布局:40个教程、技巧、例子和最佳实践" width="150" height="150" /></a><a href="https://coolshell.cn/articles/6840.html" class="wp_rp_title">CSS 布局:40个教程、技巧、例子和最佳实践</a></li><li ><a href="https://coolshell.cn/articles/3903.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/plugins/wordpress-23-related-posts-plugin/static/thumbs/14.jpg" alt="一些有意思的贴子和工具" width="150" height="150" /></a><a href="https://coolshell.cn/articles/3903.html" class="wp_rp_title">一些有意思的贴子和工具</a></li><li ><a href="https://coolshell.cn/articles/3684.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/uploads/2011/02/1128-150x150.jpg" alt="Web开发人员速查卡" width="150" height="150" /></a><a href="https://coolshell.cn/articles/3684.html" class="wp_rp_title">Web开发人员速查卡</a></li><li ><a href="https://coolshell.cn/articles/3063.html" class="wp_rp_thumbnail"><img src="https://coolshell.cn/wp-content/plugins/wordpress-23-related-posts-plugin/static/thumbs/0.jpg" alt="40个很不错的CSS技术" width="150" height="150" /></a><a href="https://coolshell.cn/articles/3063.html" class="wp_rp_title">40个很不错的CSS技术</a></li></ul></div></div>The post <a href="https://coolshell.cn/articles/2406.html">写HTML和CSS的新方法</a> first appeared on <a href="https://coolshell.cn">酷 壳 - CoolShell</a>.]]></content:encoded>
					
					<wfw:commentRss>https://coolshell.cn/articles/2406.html/feed</wfw:commentRss>
			<slash:comments>20</slash:comments>
		
		
			</item>
	</channel>
</rss>
