0

why there is no right padding 14px on select tag?
I'm on Chrome - last version

.sel{
    display:block;
    margin:0 auto;
    padding:0 14px;
    font-weight:500;
    height:31px;
    background:#007399;
    color:white;
  border-radius:25px;
  outline:none;
}
<select class='sel'>
<option value = 'lorem'>LOREM</option>
<option value = 'ipsum'>IPSUM</option>
<option value = 'dolor'>DOLOR</option>
<option value = 'sit'>SIT</option>
</select>
qadenza
  • 9,025
  • 18
  • 73
  • 126

1 Answers1

1

If you want to get an extra padding on the right of the select drop-down arrow, you need to wrap your select in a div, in this way you can have an extra padding also for the arrow. For example:

<div class="select-container">
  <select>
    <option value = 'lorem'>LOREM</option>
    <option value = 'ipsum'>IPSUM</option>
  <select>
</div>

And then, in your SCSS:

.select-container {
  padding: 0 14px;
  select {
    border: none;
    /* rest of your rules */
  }
}
Emanuele Scarabattoli
  • 4,103
  • 1
  • 12
  • 21
  • thanks , it works. btw I think my question is perfectly clear - I need the padding on `select` tag and not on any additional wraper – qadenza Nov 28 '20 at 15:30