css总结4:input 去掉外边框,placeholder的字体颜色、字号
2024-10-19 13:24:40
1 input 标签去除外边框:
在进行webAPP开发时,input外边框非常影响美观,去除外边框方法如下:
<input style="border: 0px;outline:none;cursor: pointer;" type="text" placeholder="请输入手机号">
解释:
“border: 0px;”
去除 placeholder 外的边框
“outline:none;”
“去除点击input框时显示的边框
“cursor: pointer;”
点击显示光标光标呈现为指示链接的指针(一只手)
2 placeholder的字体颜色:
查阅不同资料后发现,因为各家浏览器对css支持各有不同,所以需要对齐区别设置:
在样式表添加:
input::-webkit-input-placeholder {
/* WebKit browsers */
color: #999;
} input::-moz-placeholder {
/* Mozilla Firefox 4 to 18 */
color: #999;
} input::-moz-placeholder {
/* Mozilla Firefox 19+ */ color: #999;
} input::-ms-input-placeholder {
/* Internet Explorer 10+ */
color: #999;
}
效果:
最新文章
- 安卓Android科大讯飞语音识别代码使用详解
- 面试题目——《CC150》排序与查找
- C++基本语法
- gulp编译sass
- UnWind Segue
- cp: omitting directory”错误
- 【BZOJ-1449&;2895】球队收益&;球队预算 最小费用最大流
- php保存base64数据
- SQLite的简单应用
- Linux学习2
- 浅析SSH核心原理(二)
- oracle_根据ID(字符型)建立分区表
- pyqt样式表语法笔记(下)--原创
- 链接学习之obj文件探索
- Elasticsearch5.4署遇到的问题
- LiteQuery MAX(Integer)、MAX(String) 判断是否返回值
- CS229 6.13 Neurons Networks Implements of stack autoencoder
- JAVA 第一周学习总结
- Kubernetes学习之路(二十一)之网络模型和网络策略
- js调试系列: 调试基础与技巧