2 Answers2

3

You can use appearance-none which is a class in tailwindCSS that removes any browser specific styling.

Resource: https://tailwindcss.com/docs/appearance

inezabonte
  • 205
  • 2
  • 10
0

Yeah, to be honest most browsers have their default styles to fall back on. If you want something consistent I often use CSS, try the following and play around:

CSS:

/* Reset Select */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  -ms-appearance: none;
  appearance: none;
  outline: 0;
  box-shadow: none;

  background: white;
  border:1px solid #e7e7e7;
  background-image: none;
}
/* Remove IE arrow */
select::-ms-expand {
  display: none;
}
/* Custom Select */
.select {
  margin:1rem;
  position: relative;
  display: flex;
  width: 20em;
  height: 3em;
  line-height: 3;
  background: #2c3e50;
  overflow: hidden;
  border-radius: .25em;
}
select {
  flex: 1;
  padding: 0 .5em;
  color: #ccc;
  cursor: pointer;
}
/* Arrow */
.select::after {
  content: '\25BC';
  position: absolute;
  top: 0;
  right: 0;
  padding: 0 1em;
  background: #ccc;
  cursor: pointer;
  pointer-events: none;
  -webkit-transition: .25s all ease;
  -o-transition: .25s all ease;
  transition: .25s all ease;
}
/* Transition */
.select:hover::after {
  color: #ffffff;
}

html:

<div class="select">
  <select name="slct" id="slct">
    <option selected disabled>Choose an option</option>
    <option value="1">CSS</option>
    <option value="2">JS</option>
  </select>
</div>
  • I used plain Css in my recent project and i am using tailwind css now in this project and having same problem with – Usama Abdul Razzaq Jul 06 '21 at 12:01