Stian Berg Larsen
Stian Berg Larsen

Reputation: 553

CSS Attribute selection not working in safari

Quick question. I've tried to search, but could not find anything. Could also be because I use the wrong keywords for search.

Anyways, this is my problem:

I'm hiding certain elements on my webpage using css like this:

.selectBox option[value='6']{
    display:none;
}

Works fine on my windows pc, but Safari v8.0.6 on mac will not use the css. Are there any workarounds? I could add a new class and hide based on class, but I would like to do this using either 'value' or 'label' attribute

Fiddle: https://jsfiddle.net/qdsq5v70/

Upvotes: 1

Views: 6216

Answers (1)

OfirYaron
OfirYaron

Reputation: 157

As far as I know the short answer is No, it's not possible using CSS, safari doesn't allow styling the options, only the select container (Styling option value in select drop down html not work on Chrome & Safari)

but you can remove and add options using javascript (of course you probably know that already)

Upvotes: 1

Related Questions