2

I have tried changing border color and background in css of the combobox but it's not working:

I have this HTML code:

<select class = "form-control" style = "border:2px solid white;background:skyblue">
   <option value = "newest"> Newest </option>
   <option value = "oldest"> Oldest </option>
</select>

I just simply want to:

  1. Remove combobox border
  2. Remove the arrow of the combobox
  3. Set the background of combobox to skyblue.

I'm sorry if I could not attach any picture for SO requires me to have atleast 10 repu for me to post picture. Please help me with this one. Thanks

UPDATE: I also tried the btn-info in bootstrap but still doesn't work..

2 Answers2

0
  1. Done.
  2. You can do this, in webkit browsers only.
  3. Done.

If you want to style your combobox better, you have to write some code or useing a plugin like: select2

select {
  -webkit-appearance:none;
  appearance:none;
  border:0;
  background:skyblue;
}
<select>
  <option>Option 1</option>
  <option>Option 2</option>
  <option>Option 3</option>
</select>
Mosh Feu
  • 28,354
  • 16
  • 88
  • 135
0

Try this

get Help

.styleSelect select {
  background: transparent;
  width: 168px;
  padding: 5px;
  font-size: 16px;
  line-height: 1;
  border: 0;
  border-radius: 0;
  height: 34px;
  -webkit-appearance: none;
  color: #000;
}

.styleSelect {
  width: 140px;
  height: 34px;
  overflow: hidden;
  background: none;
  border: 2px solid #fff;
  background:skyblue
  
}
<div class="styleSelect">
  <select class="units">
    <option value="Metres">Newest</option>
    <option value="Feet">Feet</option>
    <option value="Fathoms">Oldest</option>
  </select>
</div>
Community
  • 1
  • 1
Kishan
  • 1,182
  • 12
  • 26