Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Zen Coding.
Search
cssrain
September 02, 2014
Technology
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Zen Coding.
一种快速编写代码的方法
cssrain
September 02, 2014
More Decks by cssrain
See All by cssrain
UED工作流程分享和交流
cssrain
1
540
解读HTML
cssrain
0
220
解读HTML5
cssrain
2
230
基础CSS(1)
cssrain
0
220
基础CSS(2)
cssrain
0
160
高效的CSS
cssrain
0
220
高级CSS—继承
cssrain
0
190
PhoneGap分享和交流
cssrain
0
160
PhoneGap实践
cssrain
0
110
Other Decks in Technology
See All in Technology
エンタメ企業のM&Aを支えるデータ基盤 ― 統合から店舗のリアルタイム分析まで / Data Engineering Summit 2026
genda
0
190
PHPカンファレンス関西の招待状 / Invitation to PHP Conference Kansai
ykanoh
0
200
Refining Active Record
shugo
0
160
その Valkey 使いこなしていますか?
onk
PRO
5
1.6k
『SAR衛星データ解析入門』のご紹介とその応用
syuchimu
0
120
ウォンテッドリーの最近のプロダクトと技術の紹介
stomk
0
120
宣言型部分更新は何を解決しどこへ向かうのか
shuta13
1
460
脆弱性診断って、何をしているの? 〜弱点を見つけて、会社の改善につなげるまで〜
keeg
0
930
事業成長とデータ活用を止めないためのマネジメントへ挑戦
hiracky16
0
400
無理せず続ける、子育てエンジニアの学び
codmoninc
PRO
0
960
フロントエンドカンファレンス関西2026 - 速すぎるUIに、待ち時間を
teamlab
PRO
0
180
ストレスなくAIと付き合いたい!こんなときどうしてる?
namiki64
3
600
Featured
See All Featured
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
310
A Soul's Torment
seathinner
8
3.8k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
A designer walks into a library…
pauljervisheath
211
25k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
260
Mobile First: as difficult as doing things right
swwweet
225
10k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Transcript
Zen Coding 一种快速编写HTML/CSS代码的方法 UED分享 · 交流 http://cssrain.github.io
哪些原因导致你写HTML变慢? • 很长,难记标签代码 (doctype) • 丌常写,丌熟悉的标签代码 (link) • 语义化的代码 (img的alt和title)
• Html的所有属性,括号,引用都要写完整 (dl+) • ……
记得它吗,能写出来吗? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF- 8" /> <title></title> </head> <body> </body> </html>
html:xt 演示
有什么方式快速写出? <div id="content"> <div class="page_top"> <p class="hdwrap"></p> <h1></h1> </div> <div
class="column"></div> <div class="column"></div> </div>
div#content>(div.page_top>p.hdwrap+h1)+div.column *2 演示
太复杂?拆开来 <div id="content"> <div class="page_top"> <p class="hdwrap"></p> <h1></h1> </div> <div
class="column"></div> <div class="column"></div> </div> div#content > ( div.page_top > p.hdwrap+h1 ) + div.column*2
丌就是CSS嘛 E 元素名称(div, p); E#id 使用id的元素(div#content, p#intro, span#error); E.class 使用类的元素(div.header,
p.error.critial). 你也可以联合使用class和idID: div#content.column.width; E>N 子代元素(div>p, div#footer>p>span); E+N 兄弟元素(h1+p, div#header+div#content+div#footer); E*N 元素倍增(ul#nav>li*5>a); E$*N 条目编号 (ul#nav>li.item-$*5);
这就是Zen Coding 由两个核心组件组成: • 一个缩写扩展器(缩写为像CSS一样的选择器) • 上下文无关的HTML标签对匹配器
支持大多数开发工具 • Visual Studio • TopStyle • Vim • IntelliJ
IDEA/WebStorm/PHPStorm • Aptana • Dreamweaver , Sublime Text,Editplus……
Zen Coding 资料 http://code.google.com/p/zen-coding/ https://github.com/sergeche/zen-coding/
Q&A 谢谢聆听