Get unlimited access
Open in app
Home
Notifications
Lists
Stories

Write
Ole Ersoy
Ole Ersoy

May 29

·
1 min read

Understanding CSS .selector.selector Syntax

Image by Rudy and Peter Skitterians from Pixabay

Scenario

We have a CSS rule.

.name1.name2 {
color:red;
}

And we are wondering what the selector .name1.name2 selects.

Approach

It will select elements with both class names, so for this example Hello there! will be red.

<h1 class="name1 name2">Hello there!</h1>

Demo

selector.selector - StackBlitz

A polymer project based on @polymer/lit-element.

stackblitz.com

Additional Concepts

CSS Selectors Reference

W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering…

www.w3schools.com

--

--

More from Ole Ersoy

Founder of Firefly Semantics Corporation

Love podcasts or audiobooks? Learn on the go with our new app.

Try Knowable

Recommended from Medium

Omar Moustafa

Omar Moustafa

Multiplayer Word Guessing Simple Python Game

Sakshi Agarwal

Sakshi Agarwal

in

MLearning.ai

#14 Data Engineering —TRANSFORM DATA — Duplicate Data

N. Krish

N. Krish

Coding Bootcamps: Which to go for?

Kaushal Bhogale

Kaushal Bhogale

Hello Graphics

Rodney Blightman

Rodney Blightman

The only fast way out is to deep read curses, to build a curses reader tomorrow, and deep read web…

Weekly Dev Blog

Weekly Dev Blog

Weekly Digest #71

Jade Martinez

Jade Martinez

“Using Your Fingers”

Vanamala Srinivas

Vanamala Srinivas

Blue Prism Tool

AboutHelpTermsPrivacy


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ole Ersoy

Ole Ersoy

Founder of Firefly Semantics Corporation

More from Medium

Ayyash Ayyash

Ayyash Ayyash

The perfect blockquote, Part III: Conclusion

David Cueter

David Cueter

Web Accessibility: The Web For Anyone & the Affordance Principle

Ole Ersoy

Ole Ersoy

Understanding the Angular Material Color Palette

Whitecoode

Whitecoode

Understanding Media queries in CSS

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Knowable