2339870
2339870

Reputation: 1487

Style select form

I'm trying to give my select form a background-color and border but this doesn't seem to work.

This is my HTML:

<select class="size">
    <option>maat</option>
</select>

CSS:

select.size {
    width: 170px;
    border: 2px solid #dcd8d7;
    border-radius: 4px;
    background: #ffffff;
}

Upvotes: 1

Views: 145

Answers (2)

Alex Char
Alex Char

Reputation: 33228

Change background to background-color

Also check this fiddle:

http://jsfiddle.net/NQ5vb/

You have to set a different color than white(#FFFFFF). Take a look here HTML Color Picker

Upvotes: 2

Bram
Bram

Reputation: 2580

You need to do it like this

<div class="styled-select">
  <select>
    <option>Maat</option>
  </select>
</div>

and the css is like this

.styled-select select {
   width: 170px;
   border: 2px solid #dcd8d7;
   border-radius: 4px;
   background-color: #ffffff;
}

Upvotes: 2

Related Questions