-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[css] 第97天 如何更改placeholder的字体颜色和大小? #968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
css
css
Comments
|
<style>
/* Chrome浏览器 */
input::-webkit-input-placeholder {
color: red;
}
/* 火狐浏览器 */
input::-moz-placeholder {
color: red;
}
/* IE */
input:-ms-input-placeholder {
color: red;
}
</style>
<body>
<input type="text" placeholder="你好">
</body> |
通过每个浏览器不同的属性设置
冒号前面加包含input框对应的选择器即可 |
可以通过各个浏览器的特定伪元素或伪类来设置
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
第97天 如何更改placeholder的字体颜色和大小?
The text was updated successfully, but these errors were encountered: