Selecting Disabled Items

0

I need to differentiate the view from a select box where there is an element selected by default, but it can not be selected by the user (as if it were a placeholder of a normal input), but I want to stylize it, I tried to use something like How do I get rid of this problem?

EX:

<select>
  <option disabled selected>1</option>
  <option>2</option>
  <option>3</option>
  <option>4</option>
</select>
    
asked by anonymous 24.03.2017 / 19:49

1 answer

1

Is this what you're looking for?

option[disabled]{
  color:red;
  background:rgba(255,0,0,.2);
}
<select>
  <option disabled selected>1</option>
  <option>2</option>
  <option>3</option>
  <option>4</option>
</select>
    
24.03.2017 / 22:33