如何给placeholder更改颜色

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 更改input框的字体颜色 */
        input {
            color: red;
        }
        /* 更改文本框的placeholder的颜色 */
        input[type=text]::placeholder {
            color: blue;
        }
    </style>
</head>
<body>
    <input type="text" placeholder="这里是placeholder">
    <input type="search" placeholder="pwd">
</body>
</html>

 


版权声明:本文为qq_47373340原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。