当前第2页 返回上一页
● 没有使用::placeholder选择器
● 在谷歌浏览器中
● 在Internet Explorer浏览器中
示例2:在input标签的email属性、textarea标签中使用占位符选择器
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | <!DOCTYPE html>
< html >
< head >
< meta charset = "UTF-8" >
< title >CSS更改占位符颜色</ title >
< style >
input[type="email"]::placeholder { /* Firefox, Chrome, Opera */
color: blue;
font-size: 15px;
}
textarea::placeholder { /* Firefox, Chrome, Opera */
color: red;
font-size: 15px;
}
</ style >
</ head >
< body >
< div class = "demo" >
< p >更改占位符颜色</ p >
< input type = "email" placeholder = "请输入email...." > < br />< br />
< textarea rows = "10" cols = "50" placeholder = "请输入email...." ></ textarea >
</ div >
</ body >
</ html >
|
输出:
说明:
占位符选择器可以应用于input标签的任何属性(文本,电话,密码等),以突出显示任何不同属性的颜色变化。
以上就是本篇文章的全部内容,希望能对大家的学习有所帮助。更多精彩内容大家可以关注php中文网相关教程栏目!!!
以上就是如何使用CSS更改占位符颜色?(代码示例)的详细内容,更多文章请关注木庄网络博客!
返回前面的内容
相关阅读 >>
css怎么同时插两张背景图片
详谈css的flex布局(图文介绍)
h5设计时的小技巧总结
dreamweaver网页怎么创建css样式的复合声明?_dreamweaver教程_网页制作
css怎么去掉按钮的边框
html5手机端页面缩放问题的解决详解
css list-style-type属性怎么用
html5中布尔属性的hidden
javascript可以放在css中吗
用css实现div里面的文字靠右
更多相关阅读请进入《css》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » 如何使用CSS更改占位符颜色?(代码示例)