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
CSS Pseudo Classes
Search
Frontend NE
August 29, 2015
Technology
0
450
CSS Pseudo Classes
Elizabeth Gardiner take Frontend NE through CSS pseudo selectors and pseudo classes
Frontend NE
August 29, 2015
Tweet
Share
More Decks by Frontend NE
See All by Frontend NE
Standardizing 'select': What the future holds for HTML - Stephanie Stimac @ FrontendNE
frontendne
4
390
CSS Regression testing - James A Lambert @ FrontendNE
frontendne
1
320
Building a design system for Lloyds Banking - Lilly Dart @ FrontendNE
frontendne
0
1.4k
What I learnt about hiring diverse teams from conducting a fully-anonymous recruitment process - Bethan Vicent
frontendne
0
270
Web Design that Doesn't Make Trans People Uncomfortable - Jessica Kelsall
frontendne
0
730
Contain yourself - Docker for developers
frontendne
2
250
Design process of a website
frontendne
0
290
What the JAMstack?
frontendne
1
900
Talking the talk
frontendne
0
480
Other Decks in Technology
See All in Technology
AWS IAM Identity Centerによる権限設定をグラフ構造で可視化+グラフRAGへの挑戦
ykimi
2
680
[Oracle TechNight#94] Oracle AI World 2025 Oracle Database関連フィードバック
oracle4engineer
PRO
0
310
從裝潢設計圖到 Home Assistant:打造智慧家庭的實戰與踩坑筆記
kewang
0
160
技術の総合格闘技!?AIインフラの現在と未来。
ebiken
PRO
0
240
[mercari GEARS 2025] Keynote
mercari
PRO
0
140
エンジニア採用と 技術広報の取り組みと注力点/techpr1112
nishiuma
0
130
AWS資格は取ったけどIAMロールを腹落ちできてなかったので、年内に整理してみた
hiro_eng_
0
150
コミュニティと共に変化する 私とFusicの8年間
ayasamind
0
440
メタプログラミングRuby問題集の活用
willnet
2
730
なぜインフラコードのモジュール化は難しいのか - アプリケーションコードとの本質的な違いから考える
mizzy
18
5.7k
Pythonで構築する全国市町村ナレッジグラフ: GraphRAGを用いた意味的地域検索への応用
negi111111
8
3.3k
コード1ミリもわからないけど Claude CodeでFigjamプラグインを作った話
abokadotyann
1
150
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
697
190k
Speed Design
sergeychernyshev
32
1.2k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
253
22k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
It's Worth the Effort
3n
187
28k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
Rails Girls Zürich Keynote
gr2m
95
14k
4 Signs Your Business is Dying
shpigford
186
22k
Raft: Consensus for Rubyists
vanstee
140
7.2k
The World Runs on Bad Software
bkeepers
PRO
72
12k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Transcript
Pseudo-classes Elizabeth Gardiner {@libwella}
http://www.w3schools.com/css/css_pseudo_classes.asp “A pseudo-class is used to define a special state
of an element.”
http://www.thefreedictionary.com/Psuedo pseu•do (ˈsu doʊ) adj., n., pl. -dos. adj. 1.
false or spurious; sham; pretended. n. 2. a false or pretentious person.
None
Dynamic Pseudo-classes
:hover
:link :visited :hover :active
https://flic.kr/p/3ruY7o
:link o :visited e :hover :active t e
:link :visited :hover :active
:link :visited :hover :active :focus
:link :visited :hover :active :focus
None
:link :visited :hover :active :focus
:link :visited :hover :active :focus } :any-link (proposed CSS4)
:link :visited :hover :active :focus :local-link } :any-link (proposed CSS4)
(proposed CSS4)
Structural Pseudo-classes
THE DOM!
https://flic.kr/p/9GVpoG
<ul> <li> <li> <li> <li> <li> <li> https://flic.kr/p/9GVpoG
HTML BODY UL li li li li li li
:nth-child
:nth-child(n)
:nth-child(3) <ul> <li> <li> <li> <li> <li> <li> https://flic.kr/p/9GVpoG
:first-child :last-child :first-of-type :nth-last-child :nth-of-type :nth-last-of-type :only-child :only-of-type :empty :blank
(CSS4 proposed)
:matches(CSS4 proposed) https://css-tricks.com/almanac/selectors/m/matches/
:target
BROWSER SUPPORT
DEMOS http://lea.verou.me/demos/ nth.html https://css-tricks.com/examples/ nth-child-tester/#
THE negation pseudo-class :not
Pseudo Elements
http://www.growingwiththeweb.com/2012/08/pseudo-classes-vs-pseudo- elements.html “A pseudo-element […] allows us to create items
that do not normally exist in the document tree”
::first-line ::first-letter ::before ::after
::first-line ::first-letter ::before ::after
https://css-tricks.com/pseudo- element-roundup/ http:// www.smashingmagazine.com/ 2011/07/13/learning-to-use-the- before-and-after-pseudo- elements-in-css/
Thanks! Elizabeth Gardiner {@libwella}