您的位置:首页 > 其它

改变placeholder颜色和去掉input前面的叉号

2018-03-23 22:29 337 查看
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <style>
        :-moz-placeholder { /* Mozilla Firefox 4 to 18 */
            color: red; opacity:1; 
        }
        ::-moz-placeholder { /* Mozilla Firefox 19+ */
            color: red;opacity:1;
        }
        input:-ms-input-placeholder{
            color: red;opacity:1;
        }
        input::-webkit-input-placeholder{
            color: red;opacity:1;
        }
        
        /* 清除search的默认样式 */
        input::-webkit-search-cancel-button{
          display: none;
        }
        /* --清除IE下的 search 叉号 */
        input[type=search]::-ms-clear{
          display: none;
        }
    </style>
</head>
<body>
    <input type="text" placeholder="placeholder是红色" />
    <input type="search" />

</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: