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
CSSにおける制約
Search
suzumaze
May 01, 2018
Programming
80
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
CSSにおける制約
suzumaze
May 01, 2018
Transcript
22 slides
CSSʹ͓͚Δ੍
CSSͲ͏ͱͰॻ͚Δ
CSSແޱ
CSSͱͯڧྗ
CSSͷຊ࣭ηϨΫλ
HTML Class Attribute != CSS
અࢠɺͦΕઃܭͳ͍ ໔ࡑූ <div class=“c-box__item--text js-opacity-delay__item is-active”> … </div> BEM ?
BEM? SMACSS? × OOCSS?
ۜͷʁ HTML CSS ٙࣅScoped CSS CSS in JSʢStyled Componentsʣ
CSS in JS ≒ jQuery css() Method ≒ HTML Old
Attribute
͍͍ͨؾ࣋ͪΘ͔Δ
ɿ࠶ར༻͕ఆ͞ΕΔ ίϯϙʔωϯτͷελΠϧ ଧͪফ͞Εͳ͍Α͏ৄࡉΛ࠷ߴʹʂ ɿ࠶ར༻ઌͰελΠϧΛඍௐ͢Δ͜ͱΛ ߟ͑ΕɺৄࡉΛ͓͚͍͍͋͛ͯͱ ݴ͑ͳ͍ͷͰͳ͍͔ʁ
ɿڝ߹͕ఆ͞ΕΔϓϩύςΟΛ ย͔ͬΒએݴ͓͚ͯ͠ͳ͍ ɿ࣮ࡍʹͲΜͳϓϩύςΟ͕ ద༻͞Ε͍ͯΔ͔ࣄલʹஅͰ͖ͳ͍
ͪΌΜͱॻ͖ͬ͘Όͳ͍
աෆͳ͍దͳηϨΫλ HTML <a class="btn-fb" href=“http://www.facebook.com/share.php?u=https%3A%2F%2F***.jp”> Facebook </a> CSS .page-chronicle #mainContent
.share-box dl dd .btn-fb { width: 34px; height: 34px; background: url(/img/pc/common/btn_fb.png) no-repeat left top; background-size: 100% auto; } CSS .page-chronicle > .share-box a[href*=“//www.facebook.com/share.php?u=”] { width: 34px; height: 34px; background: url(/img/pc/common/btn_fb.png) no-repeat left top; background-size: 100% auto; } HTML <a href=“http://www.facebook.com/share.php?u=https%3A%2F%2F***.jp”> Facebook </a>
dataଐੑΛ্खʹ HTML <section class=“section section01“> *** </section> CSS .section, .section01
{ padding: 15px 20px; } .section.section01 { background: url(background-section01.png); } HTML <section data-section=“about”> *** </section> CSS section[data-section] { padding: 15px 20px; } section[data-section=“about”] { background: url(background-about.png); }
ARIAΛ্खʹ
➡ HTML <p> •CSSʹ͓͚Δ੍<br> •CSSͲ͏ͱͰॻ͚Δ </p> HTML <ul> <li>CSSʹ͓͚Δ੍</li> <li>CSSͲ͏ͱͰॻ͚Δ</li>
</ul> CSS li::before { content: “•”; } ͓·͚:ྫ͑ɺຊ࣭తͳͷҎ֎CSSͰ <ol> <li>01.CSSʹ͓͚Δ੍</li> <li>02.CSSͲ͏ͱͰॻ͚Δ</li> </ol> ol { counter-reset: slide; } ol > li { list-style: none; } ol > li::before { counter-increment: slide; content: “0”counter(slide)”.“; } ⬇ <li>CSSʹ͓͚Δ੍</li> ⬇ 01.CSSʹ͓͚Δ੍
CSS [data-page-index=“1”] .navigation a[href$=“/*/**/1”] { pointer-events: none; opacity: .8; }
HTML <html data-page-index=“1”> ~ <ul class=“navigation”> <li> <a href="/special/suppose/1/1.php"> େͷՈ ౡݝࢢࢢ 2004 </a> </li> ~ </ul> ɹ͓·͚:ྫ͑ɺφϏήʔγϣϯCSSͰ
CSS html[lang=“ja”] a[href*=“/contact”] { background-image: url(/ja/img/contact.png); content: “͓͍߹Θͤ”; } html[lang=“en”]
a[href*=“/contact”] { background-image: url(/en/img/contact.png); content: “ Contact Us”; } HTML ຊޠαΠτ <html lang=“en”> <a href=“/contact”></a> ӳޠαΠτ <html lang=“en”> <a href=“/contact”></a> ͓·͚:ྫ͑ɺଟݴޠରԠCSSͰ
͋ΒΏΔ໊લҙਂ͘ ҆қʹଐੑΛৼΒͳ͍ ϚϧνΫϥεΛڋઈ
ඞཁͳͷ੍ ै͏͖ݪଇ ໔ࡑූ͍Βͳ͍
͓͠·͍
Other Decks in Programming
See All in Programming
우리의 Nitro Modules는 당신의 Turbo Modules보다 아름답다
l2hyunwoo
0
260
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
170
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
3
300
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
200
Web3Dライブラリを作ってVue Custom Rendererの仕組みを理解しよう / lets learn vue custom renderer by making 3d library
drumath2237
1
130
Modernizing iOS Apps
seyfoyun
0
150
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
250
AIがコードを書いてくれる時代、我々は何を確かめるのか
yosuke_furukawa
PRO
13
5.9k
Getting Started with Vibe Coding
miccheng
0
200
Secure Your Coding Agent Like It’s Malware (v1.5) 🇬🇧 @Code.talks 2026
richargh
0
120
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
15
11k
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
330
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
580
Become a Pro
speakerdeck
PRO
31
6.4k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
470
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
560
Accessibility Awareness
sabderemane
1
290
Code Reviewing Like a Champion
maltzj
529
40k
Everyday Curiosity
cassininazir
0
400
Documentation Writing (for coders)
carmenintech
77
5.6k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
43k