在文本转换中输入占位符的问题

时间:2018-06-11 18:13:56

标签: html css

我为输入表单编写了代码,我提到了css

text-transform:uppercase;

但是在表单中我添加了占位符作为" Name"。但是当我在实际的weppage中查看它时,占位符变为" NAME"。在大写的页面上看起来很尴尬。输入和css是:

#textbox {
            outline:none;
            background:#732ab7;
            caret-color:lightgreen;
            border-style:groove;
            border-width:0px 0px 10px 0px;
            border-top:none;
            border-left:none;
            border-right:none;
            border-bottom-color:lightgreen;
            padding:0px 0px 2px 15px;
            text-transform: lowercase;

       }

输入标签: -

<input hspace="32px" vspace="70px" id="textbox" type="text" placeholder="Name"></input>

1 个答案:

答案 0 :(得分:1)

每个浏览器都有不同的方法来控制占位符样式。使用下面的CSS来避免占位符样式

input { 
    text-transform: uppercase;
}
::-webkit-input-placeholder { /* WebKit browsers */
    text-transform: none;
}

已经有人answered检查了这个

相关问题