200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > 如何修改placeholder样式 – CSS – 前端 css3怎么设置边框为透明色

如何修改placeholder样式 – CSS – 前端 css3怎么设置边框为透明色

时间:2023-11-30 16:47:22

相关推荐

如何修改placeholder样式 – CSS – 前端 css3怎么设置边框为透明色

修改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>

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。