首页 建站教程 WEB前端 正文

自定义html5的placeholder属性字体颜色

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> ...
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>
            *{padding: 0;margin: 0;}
            input{width: 300px;height: 30px;margin-top: 100px;margin-left: 100px;}
            /*修改某个input中placeholder颜色*/
             #myinput::-webkit-input-placeholder {color: green;}
            #myinput:-moz-placeholder {/* Firefox 18- */color: green;}
            #myinput::-moz-placeholder{/* Firefox 19+ */color: green;}
            #myinput:-ms-input-placeholder {color: green;}
             /*修改某个input中placeholder颜色*/
            /*修改所有的input中placeholder颜色*/
            ::-webkit-input-placeholder {color: red;}
            :-moz-placeholder {/* Firefox 18- */color: red;}
            ::-moz-placeholder{/* Firefox 19+ */color: red;}
            :-ms-input-placeholder {color: red;}
            /*修改所有的input中placeholder颜色*/
        </style>
    </head>
    <body>
        <input type="text" placeholder="html5"/>
        <input type="text" placeholder="家居行业" id="myinput"/>
    </body>
</html>


打赏
海报

本文由优美主题原创或收集发布

转载请注明本文地址:https://www.umtheme.com/web/22.html

相关推荐

css中position:fixed如何实现相对于父级定位

css中position:fixed如何实现相对于父级定位

在项目开发中我们经常会用到position:fixed属性,它常常应用的场合是,当下拉滚动条时固定导航栏到顶部,将广告固定在页面两侧或浏览器中间。当我们使用position:fixed定位属性时,它生...
WEB前端 2023.02.12 0 668
发布评论

ainiaobaibaibaibaobaobeishangbishibizuichiguachijingchongjingdahaqiandaliandangaodw_dogedw_erhadw_miaodw_tuzidw_xiongmaodw_zhutouganbeigeiliguiguolaiguzhanghahahahashoushihaixiuhanheixianhenghorse2huaixiaohuatonghuaxinhufenjiayoujiyankeaikeliankouzhaokukuloukunkuxiaolandelinileimuliwulxhainiolxhlikelxhqiuguanzhulxhtouxiaolxhwahahalxhzanningwennonuokpinganqianqiaoqinqinquantouruoshayanshengbingshiwangshuaishuijiaosikaostar0star2star3taikaixintanshoutianpingtouxiaotuwabiweifengweiquweiwuweixiaowenhaowoshouwuxiangjixianhuaxiaoerbuyuxiaokuxiaoxinxinxinxinsuixixixuyeyinxianyinyueyouhenghengyuebingyueliangyunzanzhajizhongguozanzhoumazhuakuangzuohenghengzuoyi
感谢您的支持