我已经创建了一个输入文本字段并使用 html 为其提供了一个标签,但我没有在一行中显示标签,而是面临标签以三行显示的问题。
label {
display: inline-block;
position: relative;
width: 5px;
top: 0px;
left: -193px;
color: #999;
font-family: 'Helvetica', sans-serif;
font-size: 16px;
font-weight: lighter;
z-index: 1;
transition: all 0.2s ease-in;
}
<input type="text" name="verficationcode" required autocomplete="off">
<label for="verficationcode">Enter code here</label>
最佳答案
注释掉或调整width
属性:
label {
display: inline-block;
position: relative;
/*width: 5px;*/
top: 0px;
/*left: -193px;*/
color: #999;
font-family: 'Helvetica', sans-serif;
font-size: 16px;
font-weight: lighter;
z-index: 1;
transition: all 0.2s ease-in;
}
<input type="text" name="verficationcode" required autocomplete="off">
<label for="verficationcode">Enter code here</label>
关于HTML 文本字段的标签显示为三行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47525493/