html - 选择选项字体大小不变
问题描述
我已经通过将它放在课堂上进行了尝试,然后通过访问我也尝试过 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>
解决方案
试试这个..
<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>
推荐阅读
- html - 如何隐藏可编辑内容的可调整大小边框?
- sql-server - 我怎样才能在我的查询中求和?附上 Sql 服务器查询
- android - 用另一个 EditText 动态替换 TextInputLayout 中的 EditText
- excel - EXCEL公式——CountIf——如何排除满足一定条件的单元格
- python - Pandas groupby mean() 不忽略 NaN
- c - 使用 C 中的 openmp,如何并行化包含 qsort 的嵌套比较函数的 for 循环?
- docker - 同一个 Zalenium 容器中的多个浏览器
- jquery - 单击按钮内的元素在Firefox中不起作用
- angular - 如何在我的 Angular 项目中实现 HTML+CSS 模板?
- python - NameError:未定义名称“第一个”我该怎么办?