MaterializeCSS Select Background Color

KetZoomer

I tried the background color of the MaterializeCSS select. I attempted to use this question, but it did not work Change select box option background color as it was for regular HTML (no Materialize).

How could I do this?

radrex

It has to do with Materialize's selectors. The below code worked for me:

<link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<div class="input-field col s12">
    <select class="select1">
        <option value="1" selected>Option 1</option>
        <option value="2">Option 2</option>
        <option value="3">Option 3</option>
    </select>
    <label>Materialize Select</label>
</div>
<style>
  input.select-dropdown {
      background: #1A1B1C !important;
      color: #26a69a;
  }
  ul.dropdown-content.select-dropdown li span {
      background: #1A1B1C; 
  }
</style>
<script>
    document.addEventListener('DOMContentLoaded', function() {
        var elems = document.querySelectorAll('select');
        var instances = M.FormSelect.init(elems);
    });
</script>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

MaterializeCSS Select Background Color

From Dev

Changing background color of tab content with MaterializeCSS

From Dev

How to change the text color in a Materializecss select dropdown?

From Dev

select group background color labels

From Dev

Color background <Select> on page load

From Dev

materializecss - video in the background

From Dev

AngularJS - Set background color on select ngOptions of select

From Dev

Multiple Select in MaterializeCSS?

From Dev

Vuejs + Materializecss select field

From Dev

MaterializeCSS multiple select not working

From Dev

Unable to select options in materializecss select

From Dev

select2 change background color

From Dev

Select item background color different for each option

From Dev

select2 change background color

From Dev

Change background color of drop down menu on select

From Dev

select dropdown list background color effects view

From Dev

jQuery checkbox select all and change background color on select

From Dev

How to align label with select in MaterializeCSS?

From Dev

Unable to select radio button in MaterializeCSS

From Dev

Why does Firefox set a background color on the select arrow button when I set a custom border or background color?

From Dev

How to put background-color only a section of a select? CSS

From Dev

HTML <select> with background-color <option> tags using Chrome

From Dev

Change IE background color on unopened, focused select box

From Dev

Javascript: Change select background-color if option is selected

From Dev

Change background color select element based on the selected option dynamically

From Dev

How can change the div background color when dropdown select?

From Dev

How to set selected item background color in Select element?

From Dev

CSS <select> dropdown not displaying background color in iOS/iPAD browsers

From Dev

Background as color and background as image

Related Related

  1. 1

    MaterializeCSS Select Background Color

  2. 2

    Changing background color of tab content with MaterializeCSS

  3. 3

    How to change the text color in a Materializecss select dropdown?

  4. 4

    select group background color labels

  5. 5

    Color background <Select> on page load

  6. 6

    materializecss - video in the background

  7. 7

    AngularJS - Set background color on select ngOptions of select

  8. 8

    Multiple Select in MaterializeCSS?

  9. 9

    Vuejs + Materializecss select field

  10. 10

    MaterializeCSS multiple select not working

  11. 11

    Unable to select options in materializecss select

  12. 12

    select2 change background color

  13. 13

    Select item background color different for each option

  14. 14

    select2 change background color

  15. 15

    Change background color of drop down menu on select

  16. 16

    select dropdown list background color effects view

  17. 17

    jQuery checkbox select all and change background color on select

  18. 18

    How to align label with select in MaterializeCSS?

  19. 19

    Unable to select radio button in MaterializeCSS

  20. 20

    Why does Firefox set a background color on the select arrow button when I set a custom border or background color?

  21. 21

    How to put background-color only a section of a select? CSS

  22. 22

    HTML <select> with background-color <option> tags using Chrome

  23. 23

    Change IE background color on unopened, focused select box

  24. 24

    Javascript: Change select background-color if option is selected

  25. 25

    Change background color select element based on the selected option dynamically

  26. 26

    How can change the div background color when dropdown select?

  27. 27

    How to set selected item background color in Select element?

  28. 28

    CSS <select> dropdown not displaying background color in iOS/iPAD browsers

  29. 29

    Background as color and background as image

HotTag

Archive