Вариант CSS Не работает - таблица стилей пользовательского агента - PullRequest
1 голос
/ 07 августа 2020

enter image description here

I've been searching for a few days for an answer to this. The option element is not getting styled. Currently, I'm not sure if it's this user agent stylesheet overriding my style for the option element. I tried styling the option in my own CSS file however it gets canceled out. Every other HTML element on the same page is working and is styled correctly. It's just the element. I'm also using bootstrap.

What I've tried to solve:

  1. add classes
  2. add id
  3. add !important
  4. inline styling

Basically everything to target a specific/all option element(s) but it all does not seem to work. I'm not sure if I'm doing it right. Or is there something I'm missing which I can't seem to see? Thank you for your suggestions.

select#cur_to option{
  background-color: white !important;
  color: black !important;  
}
   

1 Ответ

0 голосов
/ 07 августа 2020

Теги параметров стиля практически невозможно, вы можете стилизовать только некоторые вещи.

Поскольку у вас установлен bootstrap, вы можете добавить этот плагин для этой цели: https://github.com/davidstutz/bootstrap-multiselect

...