怎么修改placeholder字体的css样式
修改palceholder内文字的css样式
::-webkit-input-placeholder{
color: red;
font-size: 20px;
line-height: 50px;
}
修改class名为test1的元素palceholder内文字css样式
.test1::-webkit-input-placeholder{
color: red;
font-size: 20px;
line-height: 50px;
}
例子:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style> input{ height: 50px; font-size: 14px; line-height: 50px; } .test1::-webkit-input-placeholder{ color: red; font-size: 20px; line-height: 50px; } </style> </head> <body> <input class="test1" type="text" placeholder="测试" /> <input type="text" placeholder="测试" /> </body> </html>
至于兼容,加上相应浏览器的前缀
。
相关推荐
Ydgent 2017-11-01
JM 2020-05-04
haidaoxianzi 2020-04-18
81570790 2020-04-16
攻城师 2013-05-14
haohong 2020-01-17
JM 2019-12-22
cherry0 2019-12-13
拭血 2019-11-17
hnyzyty 2019-11-04
zyhui 2019-09-08
jiedinghui 2018-04-03
zZoOoOJaVa 2018-02-19
MayMatrix 2015-01-09
hualala 2019-07-01
LiteHeaven 2019-06-30