WeAreDevelopers LIVE • Nov 27, 2024

Tips and Tricks: CSS Pseudo Class Selectors and Pseudo Elements

Dan Cranney

Stop over-relying on JavaScript for simple UI states. Master advanced CSS selectors to build pure-CSS interactive components and drastically reduce DOM clutter.

Pause
Mute Enter Fullscreen
#1 about 1 min

Core differences between pseudo classes and pseudo elements

The fundamental characteristics distinguishing how specific structural sub-parts of elements are targeted versus standard dynamic interaction states.

#2 about 2 min

Grouping element styles with the is pseudo class

How to condense redundant target blocks and apply shared styling formats robustly across grouped button categories securely.

#3 about 2 min

Styling elements dynamically using the checked pseudo class

Updating visual properties of layout neighbors reliably dependent on underlying form checkbox ticks without deploying frontend logic.

#4 about 1 min

Combining hover pseudo classes with the next sibling selector

Unveiling hidden tooltip components dynamically by securely chaining cursor hovering thresholds directly onto nearby structural document nodes.

#5 about 1 min

Conditional parent styling using the has pseudo class

Injecting targeted layout foundations and container aesthetics proactively contingent on particular required graphical subsets registering internally.

#6 about 2 min

Inserting automatic placeholders using the empty pseudo class

Preventing broken aesthetic bounds by automatically rendering supplementary warning wording wherever standard component contents natively evaluate vacant.

#7 about 2 min

Generating text highlights using the before pseudo element

Producing stylized background offsets immediately placed preceding designated text content elements utilizing absolutely anchored layer injections sequentially.

#8 about 2 min

Formatting typography layouts with first line and letter elements

Building stylized drop caps and natively tracked introductory heading leads replicating printed publication formatting without rewriting structure semantics.

Matching moments

6:57 min

Replacing JavaScript interactions with native CSS features

Chris Heilmann Chris Heilmann +2 · LIVE

7:10 min

Testing CSS property knowledge and layout engine quirks

Chris Heilmann Chris Heilmann +2 · LIVE

6:14 min

Rediscovering forgotten and highly useful HTML elements

Chris Heilmann Chris Heilmann +2 · LIVE

4:53 min

Exploring advanced DOM selection capabilities using CSS attributes

Chris Heilmann Chris Heilmann +2 · LIVE

5:17 min

Navigating the growing complexity of modern CSS architecture

Chris Heilmann Chris Heilmann +2 · LIVE

2:04 min

Introduction to modern CSS capabilities for designers

Onur Gumus · LIVE