1

I have problem with select options styling. I am able to change background and text color, but I can change size of dropdown. Maybe some could tell me what I am doing wrong?

My select:

<Select>
    <option value="" hidden>Type</option>
    <option value="1">Audi</option>
    <option value="2">BMW</option>
    <option value="3">Citroen</option>
    <option value="4">Ford</option>
 </Select>

My Styled-component:

const Select = styled.select`
  width: 100%;
  height:35px;
  background: white;
  color: gray;
  padding-left: 5px;
  font-size: 14px;
  border:none;
  margin-left: 10px;

       option {
         color: black;
         background: white;
         font-weight: small;
         display: flex;
         white-space: pre;
         min-height: 20px;
         padding: 0px 2px 1px;
       }
`;

How my select looks like: Select photo

PrEto
  • 395
  • 2
  • 7
  • 23

1 Answers1

1

The styles that you can give to an option element are the background-color and color. The other options are ignored. You can see more details in the question below.

How to style the option of an html "select" element?

Dmarin
  • 23
  • 4