0

How can I make a drop-down look like in th image using only HTML/HTML5?

enter image description here

I tried using this code,but it does not generates drop-down exactly as required. :

 <select name="Select1" size="3">
<!--<option value="">- Please select a name -</option>-->
<option value"210">210</option>
<option value="110">110</option>
<option value="410">410</option>
<option value="337">337</option>
</select>

Thanks in advance.

fnaticRC ggwp
  • 955
  • 1
  • 11
  • 20

2 Answers2

0

Just remove size="3" from select will make as per your expected.

<select name="Select1" >
    <!--<option value="">- Please select a name -</option>-->
    <option value="210">210</option>
    <option value="110">110</option>
    <option value="410">410</option>
    <option value="337">337</option>
</select>
ketan
  • 19,129
  • 42
  • 60
  • 98
0

Customizing the scrollbar is not an easy thing and is not supported in Firefox, look at this answer:

CSS customized scroll bar in div

For styling only the select try this method:

.container, select{
  position: relative;

}

select {
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid black;
  width: 100px;
  height: 30px;
  padding-left:5px;
  background: transparent;
}

select::-ms-expand {
    display: none;
}


#separator{
  position: absolute;
  top: 5px;
  left: 70px;

}

#arrow{
  position: absolute;
  top: 10px;
  left: 80px;
  font-size: 10px;

}
<div class="container">
  <span id="separator">|</span>
  <span id="arrow">&#x25BC;</span>
  
  <select>
    <option>Option</option>
    <option>Option</option>
    <option>Option</option>
    <option>Option</option>
    <option>Option</option>
  </select>
  
</div>
Community
  • 1
  • 1
Claudio King
  • 1,606
  • 1
  • 10
  • 12