Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to have a CSS selector based on a CSS property (and its value)?

For example, I want a CSS selector for all div elements which have a CSS overflow:auto; property. Is it possible to have a selector of that kind?

like image 947
Solace Avatar asked Dec 16 '15 03:12

Solace


1 Answers

Note that style="overflow:auto;" will match divs which has exact that CSS (string). If you want to select divs that contains overflow:auto along with some other css, you can use * selector.

div[style*="overflow:auto;"]{
  background-color: #f00;
}
like image 63
GorvGoyl Avatar answered Sep 17 '22 23:09

GorvGoyl