Vertical scrollbar overlay round-bordered select with CSS

Viewed 1515

I have one multiple select with some options inside.

select {
  overflow-y:scroll;
  height: 200px;
 border: 1px solid #c4c7cc;
 border-radius: 20px;
 margin: 0;
 padding: 10px;
 color: #323232;
 width: 100%;
 transition: border-color 0.25s ease;
 font-size: 12px;
}

select:not([disabled]):hover,
select:not([disabled]):focus {
 border-color: #ff7900;
}

select[disabled] {
 opacity: 0.5;
}
<div>
  <select multiple class="form-control">
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
    <option>5</option>
  </select>
</div>

My preference is to use default scrollbar and always show vertical scrollbar. But my select has border-radius so when running, the vertical scrollbar hides select's top-right and bottom-right corner.

This works well in IE11 because there is enough space in IE11 for the scrollbar not hiding the corners. But in Chrome, it overlays.

I have tried ::-webkit-scrollbar but it always ask me to use customized scrollbar, which I don't want.

So the question is how to make space in select between scrollbar and the border?

https://jsfiddle.net/x2eqqhqy/

3 Answers
Related