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
pro css
Search
xuyannan
January 06, 2013
Technology
170
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
pro css
how to improve our css skills
xuyannan
January 06, 2013
Other Decks in Technology
See All in Technology
触りたくないデータに、どう触るか AI時代のRBACアクセスガバナンス
ivry_presentationmaterials
0
260
スキマバイトという雇用形態は存在しないので、雇用期間1日のアルバイト契約を事業者とワーカーが結ぶ手続きを支えるのがタイミーなんです
akitoshiga
0
200
遠藤な_めぐろLT #38 「社内のAI活用推進」@麻布台_20261009
endonanana
0
130
How to Design Configuration for Rails Applications
willnet
1
770
継続的なAIコスト最適化
bgpat
1
340
ブラウザとサーバーから考えるAI時代のフロントエンド監視
shogo4131
3
940
Benchmarking Disaggregated Serving on vLLM + Dynamo with a Real Coding-Agent Workload
nttcom
1
190
「事実」を「計測」して、「解釈」する 〜AWS Lambdaのメモリ最適解の見つけ方〜
maimyyym
0
170
DGX Spark でどこまでハッキングができるのか?
kash1064
3
1.3k
[JAWS-UG彩の国埼玉#12]そろそろ準備する?re:Invent2026をやさしく解説 / reinvent2026-sainokuni
sh_fk2
1
340
Getting Started with Google Antigravity
glaforge
0
300
DWH の限界突破! AI エージェント向け爆速リアルタイムデータ基盤 ClickHouse
jozono
1
470
Featured
See All Featured
Utilizing Notion as your number one productivity tool
mfonobong
4
620
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
950
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
320
Six Lessons from altMBA
skipperchong
29
4.5k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Exploring anti-patterns in Rails
aemeredith
4
540
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Unsuck your backbone
ammeep
672
58k
Rails Girls Zürich Keynote
gr2m
96
14k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
410
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
Transcript
PRO CSS 2012.12.19 13年1月6⽇日星期⽇日
专业和非专业的区别 13年1月6⽇日星期⽇日
目的是要让大家可以区 分什么是好的,什么是 不好的。 如何写出好的 css 13年1月6⽇日星期⽇日
cೂޅิۚ$44ඣ c$44ࡏܒ 13年1月6⽇日星期⽇日
1.Don’t rush you code and keep it simple 13年1月6⽇日星期⽇日
cೂޅಀൌགྷĤ c֥Ϸم൞ቋႪ֥ગĤ cႵљ֥ϷمગĤ cೂޅಀႪ߄Ĥ 13年1月6⽇日星期⽇日
ᅧࠎЧᆩ്ࠣె 13年1月6⽇日星期⽇日
%3: 对于其他语⾔言来说,可以通 过函数(function)之类的东东 来避免重⽤用, ⽽而在CSS⾥里, 可以通过编写可复⽤用的类 (class)来做到这⼀一点。不过有 时,通过简单的重构 (refactoring)就可以实现 13年1月6⽇日星期⽇日
.navigation li {color: #333;} .navigation li a {color: #333;} /*refatcoring
重构如下:*/ .navigation li, .navigation li a { color: #333; } 13年1月6⽇日星期⽇日
4.OOCSS 13年1月6⽇日星期⽇日
ଢѓğิིۚੱބॖົྟ ൌགྷğ ࢲܒაຓܴٳ ಸఖაଽಸٳ ఙႨ*%࿊ᄴఖ Y 13年1月6⽇日星期⽇日
#my-button, .my-box, .my-box img { border: 1px solid #444; border-radius:
5px; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); } .skin { border: 1px solid #444; border-radius: 5px; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); } 13年1月6⽇日星期⽇日
#main h2 { color: #343434; font-size: 25px; line-height: 20px; ...
} 13年1月6⽇日星期⽇日
5.CSS3 13年1月6⽇日星期⽇日
c ᄸહҌିൌགྷᆃ۱ིݔĤ c ݺ֥đᆩ֡ᅇϷਔbᆃᇕٚم൞DTTॖၛൌགྷ֥હĤ c ॖၛđܣ൙ࢲඏ c ҂ॖၛđࣉྛֻ҄ c ᛍফఖ֥ᆦӻ౦ঃೂޅĤ
c (PPEđཬၩනđܣ൙ࢲඏb c ҂ݺđࣉྛֻ҄ c ᆃᇕིݔđࣇࣇ൞ุဒ֥ิശđߎ൞ܱۿି c ࣇࣇ൞ุဒ֥ิശğؓႿ҂ᆦӻ֥ᛍফఖ҂ቓԩđࠇᆀ۳ԛ၂۱߭ ٚσ GBMMCBDL c ൞ܱۿିđࣉྛֻ҄ c ପીљ֥Ϸمਔđсྶေᅳ֞ࢳथ֥ٚم 13年1月6⽇日星期⽇日
DEMO 13年1月6⽇日星期⽇日
13年1月6⽇日星期⽇日
ᇯ҄ิശაႪࢆࠩ 13年1月6⽇日星期⽇日
其他 • CSS预处理器 • 关注未来 • 阅读其他⼈人的代码 • 不断实践 13年1月6⽇日星期⽇日
$44ࡏܒ 13年1月6⽇日星期⽇日
cॖყྟ cॖᇗႨྟ cॖົྟ cॖঔᅚྟ ݺࡏܒ 13年1月6⽇日星期⽇日
༵টुुّ૫࢝ҋ 13年1月6⽇日星期⽇日
ࠎႿڳჭটྩڿቆࡱ֥ဢൔ .widget { background: yellow; border: 1px solid black; color:
black; width: 50%; } #sidebar .widget { width: 200px; } body.homepage .widget { background: white; } 13年1月6⽇日星期⽇日
ݖႿگᄖ֥࿊ᄴఖ #main-nav ul li ul li div { } #content
article h1:first-child { } #sidebar > div > h3 + p { } 13年1月6⽇日星期⽇日
ݖႿ௴๙ ၞᇗ ֥DMBTTӫ <div class="widget"> <h3 class="title">...</h3> <div class="contents"> Lorem
ipsum dolor sit amet, consectetur adipiscing elit. Vivamus elementum accumsan dignissim. <button class="action">Click Me!</button> </div> </div> .widget {} .widget .title {} .widget .contents {} .widget .action {} 13年1月6⽇日星期⽇日
၂่ܿᄵቓݖ؟֥൙౦ .widget { position: absolute; top: 20px; left: 20px; background-color:
red; font-size: 1.5em; text-transform: uppercase; } 13年1月6⽇日星期⽇日
ᄜটुुቋࡄൌ 13年1月6⽇日星期⽇日
ܿхԊ /* Grenade */ #main-nav ul li ul { }
/* Sniper Rifle */ .subnav { } 13年1月6⽇日星期⽇日
ٳطᇍᆭ ҃अބק໊ႋھႮః৫֥҃अဢൔ ࠇ৫֥ಸఖটڵᄳ 13年1月6⽇日星期⽇日
ଁॢࡗ /* High risk of style cross-contamination */ .widget {
} .widget .title { } /* Low risk of style cross-contamination */ .widget { } .widget-title { } 13年1月6⽇日星期⽇日
DTTࢲܒ۷Ⴕઆࠠྟ ࠎԤো CBTF ҃अ MBZPVU ଆॶ NPEVMFT ሑ TUBUF 13年1月6⽇日星期⽇日
ႨDMBTTটקၬဢൔđࣇࣇ൞ קၬဢൔ js-* support-* 13年1月6⽇日星期⽇日
۷Ⴕઆࠠྟ֥ଁ /* A component */ .button-group { } /* A
component modifier (modifying .button) */ .button--primary { } /* A component sub-object (lives within .button) */ .button__icon { } /* A layout class */ .l-header { } 13年1月6⽇日星期⽇日
BE PRO thanks 13年1月6⽇日星期⽇日