如何修改placeholder样式?
修改palceholder内文字的css样式
1 ::-webkit-input-placeholder{
2 color: red;
3 font-size: 20px;
4 line-height: 50px;
5 }
修改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>
Copyright © 广州京杭网络科技有限公司 2005-2025 版权所有 粤ICP备16019765号
广州京杭网络科技有限公司 版权所有