1

So, I have styled my select & the option menu to make it look like this.

enter image description here

body {
   background-color: #1A1C1E;
}

select {
  color: white;
  background: transparent;
  border: 1px solid gray;
  border-radius: 7px;
}

select option {
  color: white;
  border-color: #212529;
  background-color: #212529;
}
<select name="state" class="p-2 pe-3" id="timeline">
  <option value="5">24 Hours</option>
  <option value="25">1 Week</option>
  <option value="50">1 Month</option>
  <option value="100">3 Months</option>
</select>

The issue is that there is some white space on the bottom and top of the option menu when the color of the text is white and the background transparent.

EDIT:
I used the background from the body, the color is still a little bit off but it isn't that noticeable as before.

GoekhanDev
  • 326
  • 2
  • 4
  • 20
  • The "problem" is background of select. – Simone Rossaini Jul 20 '22 at 18:18
  • Well yes, I know. That's why I am asking how can I have the background transparent without the white space. – GoekhanDev Jul 20 '22 at 18:19
  • Does this answer your question? [CSS for Select Option to be transparent background](https://stackoverflow.com/questions/23719520/css-for-select-option-to-be-transparent-background) – Ouroborus Jul 20 '22 at 18:46
  • To summarize: You can't style the background dropdown panel and the select widget separately and the panel ignores transparency. If you want to style it the way you're asking, you'll need a replacement that uses other elements to simulate a select element. Fortunately there are a number of libraries that provide a select element or a full UI suite. – Ouroborus Jul 20 '22 at 18:49
  • try this this solution
    https://stackoverflow.com/questions/14639638/how-to-remove-border-of-drop-down-list-css
    – Suren Jul 20 '22 at 23:19

0 Answers0