首页 > 解决方案 > 选择选项字体大小不变

问题描述

我已经通过将它放在课堂上进行了尝试,然后通过访问我也尝试过 optgrp 的课程进行编辑,但这也没有奏效。

请在下面查看我的代码

<style>
select {
    width: 300px; 
    margin: 10px; 

font-size:10px;
border:0; 
-webkit-appearance: none;
}

select:focus {
    min-width: 300px;
    width: 300px;
}       

</style>
<label for="Department">Choose a Department:</label>
<select name="Select Department" onchange="location = this.value;">

<option value="#">All Departments</option>
<option value="#">Cardiology</option>
<option value="#">Plastic, Cosmatic & Reconstrustive Surgery</option>
<option value="#">Dentistry</option>


</select>

标签: htmlfontsoption

解决方案


试试这个..

<style>
.drpdwn-style{
    width: 300px; 
    margin: 10px; 

font-size:10px;
border:0; 
-webkit-appearance: none;
}  
</style>
<label for="Department">Choose a Department:</label>
<select name="Select Department" class= "drpdwn-style" onchange="location = this.value;">
<option value="#">All Departments</option>
<option value="#">Cardiology</option>
<option value="#">Plastic, Cosmatic & Reconstrustive Surgery</option>
<option value="#">Dentistry</option>
</select>


推荐阅读