当前位置:网站首页>取消select的默认样式的向下箭头和设置select默认字样
取消select的默认样式的向下箭头和设置select默认字样
2022-07-07 22:30:00 【super码力】
取消select的默认样式的向下箭头
向下箭头如下图:

这里可以设置这样子一个属性appearance:none;可以清除select的默认样式,变成如下图的样子:

样式代码:
//样式
<style>
select{
width: 100px;
appearance:none; //清除默认样式
}
</style>
//结构
<body>
<form action="">
<select name="" id="">
<option value="">北京</option>
<option value="">武汉</option>
<option value="">上海</option>
</select>
</form>
</body>select设置默认字样
默认字样只显示一次,在选项中不出现,效果如下图:

样式代码:
<body>
<form action="">
<select>
//关键代码行
<option selected="selected" disabled="disabled" style='display: none' value=''>请选择性别</option>
//选项
<option>男</option>
<option>女</option>
</select>
</form>
</body>
边栏推荐
- 爬虫实战(八):爬表情包
- [programming problem] [scratch Level 2] December 2019 flying birds
- 从Starfish OS持续对SFO的通缩消耗,长远看SFO的价值
- 接口测试进阶接口脚本使用—apipost(预/后执行脚本)
- Go learning notes (2) basic types and statements (1)
- Relevant methods of sorting arrays in JS (if you want to understand arrays, it's enough to read this article)
- Su embedded training - Day3
- How to learn a new technology (programming language)
- 服务器防御DDOS的方法,杭州高防IP段103.219.39.x
- The difference between -s and -d when downloading packages using NPM
猜你喜欢

ROS from entry to mastery (IX) initial experience of visual simulation: turtlebot3

80%的人答错,苹果logo上的叶子到底朝左还是朝右?

How to learn a new technology (programming language)

【编程题】【Scratch二级】2019.03 绘制方形螺旋

52岁的周鸿祎,还年轻吗?

全自动化处理每月缺卡数据,输出缺卡人员信息

Detailed explanation of interview questions: the history of blood and tears in implementing distributed locks with redis

Single machine high concurrency model design

Tencent security released the white paper on BOT Management | interpreting BOT attacks and exploring ways to protect

【测试面试题】页面很卡的原因分析及解决方案
随机推荐
大数据开源项目,一站式全自动化全生命周期运维管家ChengYing(承影)走向何方?
玩转Sonar
Trust orbtk development issues 2022
Usage of limit and offset (Reprint)
备库一直有延迟,查看mrp为wait_for_log,重启mrp后为apply_log但过一会又wait_for_log
CoinDesk评波场去中心化进程:让人们看到互联网的未来
【转载】解决conda安装pytorch过慢的问题
Development of a horse tourism website (optimization of servlet)
动态库基本原理和使用方法,-fPIC 选项的来龙去脉
玩轉Sonar
The difference between -s and -d when downloading packages using NPM
爬虫实战(八):爬表情包
paddle入门-使用LeNet在MNIST实现图像分类方法一
C# 泛型及性能比较
商品的设计等整个生命周期,都可以将其纳入到产业互联网的范畴内
fabulous! How does idea open multiple projects in a single window?
Introduction to paddle - using lenet to realize image classification method I in MNIST
How to put recyclerview in nestedscrollview- How to put RecyclerView inside NestedScrollView?
第一讲:链表中环的入口结点
Relevant methods of sorting arrays in JS (if you want to understand arrays, it's enough to read this article)