Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What kind of a CSS selector can I use to select an element that has more than one class?

Tags:

html

css

I have the following HTML:

<div class="block-content no-title grey-bg">

How can I set the background of this div to the color to #333?

Is there some kind of CSS selector that I can use to select just those block-content divs that have grey-bg?


1 Answers

There is something strange about your question.
This:

How can I set the background of this div to the color to #333?

Indicates you want this selector: [.grey-bg][.no-title][.block-content] (use one or more of the parts in square brackets).
This:

Is there some kind of CSS selector that I can use to select just those block-content divs that have grey-bg?

indicates you want this: .grey-bg.block-content.

like image 81
11684 Avatar answered Dec 11 '25 12:12

11684