设置input 中placeholder的样式
一、效果
二、代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
::-webkit-input-placeholder { /* Chrome/Opera/Safari */
color: red;
}
::-moz-placeholder { /* Firefox 19+ */
color: red;
}
:-ms-input-placeholder { /* IE 10+ */
color: red;
}
:-moz-placeholder { /* Firefox 18- */
color: red;
}
</style>
</head>
<body>
名字:<input type="" name="" placeholder="我是一个测试">
</body>
</html>
三、HTML input placeholder支持的属性
- font properties
- color
- background properties
- word-spacing
- letter-spacing
- text-decoration
- vertical-align
- text-transform
- line-height
- text-indent
- opacity
eg1、
效果
代码:
input::-webkit-input-placeholder {
padding-left:30px;
opacity:0.5;
}
剩下的大家自己去测哈~
还没有评论,来说两句吧...