Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Zen Coding.
Search
cssrain
September 02, 2014
Technology
0
93
Zen Coding.
一种快速编写代码的方法
cssrain
September 02, 2014
Tweet
Share
More Decks by cssrain
See All by cssrain
UED工作流程分享和交流
cssrain
1
410
解读HTML
cssrain
0
120
解读HTML5
cssrain
2
140
基础CSS(1)
cssrain
0
130
基础CSS(2)
cssrain
0
94
高效的CSS
cssrain
0
150
高级CSS—继承
cssrain
0
110
PhoneGap分享和交流
cssrain
0
84
PhoneGap实践
cssrain
0
62
Other Decks in Technology
See All in Technology
Yamla: Rustでつくるリアルタイム性を追求した機械学習基盤 / Yamla: A Rust-Based Machine Learning Platform Pursuing Real-Time Capabilities
lycorptech_jp
PRO
4
150
生成AI時代の開発組織・技術・プロセス 〜 ログラスの挑戦と考察 〜
itohiro73
1
330
AIのAIによるAIのための出力評価と改善
chocoyama
2
590
mrubyと micro-ROSが繋ぐロボットの世界
kishima
2
360
ひとり情シスなCTOがLLMと始めるオペレーション最適化 / CTO's LLM-Powered Ops
yamitzky
0
450
AI導入の理想と現実~コストと浸透〜
oprstchn
0
120
PHPでWebブラウザのレンダリングエンジンを実装する
dip_tech
PRO
0
210
Delegating the chores of authenticating users to Keycloak
ahus1
0
130
データプラットフォーム技術におけるメダリオンアーキテクチャという考え方/DataPlatformWithMedallionArchitecture
smdmts
5
660
AWS Organizations 新機能!マルチパーティ承認の紹介
yhana
1
180
LangSmith×Webhook連携で実現するプロンプトドリブンCI/CD
sergicalsix
1
120
Tech-Verse 2025 Global CTO Session
lycorptech_jp
PRO
0
810
Featured
See All Featured
Building an army of robots
kneath
306
45k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
36
2.8k
Visualization
eitanlees
146
16k
RailsConf 2023
tenderlove
30
1.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
24k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Site-Speed That Sticks
csswizardry
10
670
Bash Introduction
62gerente
614
210k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
2.9k
KATA
mclloyd
30
14k
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 谢谢聆听