如何将 VW 和 VH 值设置为 select 选项

How to set VW and VH value to select option

有人能告诉我如何用 select 选项的 VW 和 VH 值替换响应式 bootstrap 吗?

我正在尝试重新创建 here。但我不明白它的基本用法。

我需要我的 select 选项表现得像 link。

这是我的正常 bootstrap fiddle 。但是我不想用 bootstrap

updated fiddle

我的极简 HTML 结构

<select class="form-control" id="gender1">
    <option>Male</option>
    <option>Female</option>
</select>

注意:我真正需要的是,select 选项在根据DIV 调整大小时应该表现良好。我在 VW 中为 DIV

给出了 WIDTHHEIGHT

感谢大家,

select{
  display: block;
  width: 100%; /* define the size of the width */
  max-width: 100vw; /* the width equal to screen larger */
}
<label for="gender1">I'm label</label>   
<select id="gender1">
  <option>Male</option>
  <option>Female</option>
</select>

你好,这是我的代码。您只需要修改 select 宽度的值即可更改选项的大小。希望对您有所帮助!