设置placeholder字体颜色代码
分类:实例代码
设置placeholder字体颜色代码属于前端实例代码,有关更多实例代码大家可以查看。
分享一段代码实例,它实现了修改placeholder规定文字颜色的效果。
关于placeholder属性可以参阅input标签 placeholder属性用法介绍一章节。
代码实例如下:
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="author" content="http://www.pipipi.net/" /> <title>前端教程网</title> <style type="text/css"> input::-webkit-input-placeholder { color:green; } input:-moz-placeholder { color:green; } input::-moz-placeholder{ color:green; } input:-ms-input-placeholder { color:green; } </style> </head> <body> <input type="text" placeholder="www.pipipi.net"> </body> </html>
设置placeholder字体颜色代码,这样的场景在实际项目中还是用的比较多的,关于设置placeholder字体颜色代码就介绍到这了。