【发布时间】:2015-11-20 07:45:05
【问题描述】:
我将放一张图片,以便您了解我的想法。这不像存在的占位符,除非在框中放置了一些文本。
输入新信息时标签不会消失。
a sample form field design, i don't know if this can be translated to code
【问题讨论】:
-
如果我理解你,你可以用
position: absolute:)
我将放一张图片,以便您了解我的想法。这不像存在的占位符,除非在框中放置了一些文本。
输入新信息时标签不会消失。
a sample form field design, i don't know if this can be translated to code
【问题讨论】:
position: absolute :)
这里是你怎么做的示例
.input-with-label {
display: inline-block;
position: relative;
width: 200px;
}
.input-with-label input {
padding: 20px 5px 5px 5px;
}
.input-with-label .lbl {
position: absolute;
left: 5px;
top: 5px;
font-size: 12px;
opacity: 0.5;
}
<span class="input-with-label">
<input type="text" />
<span class="lbl">Contracted Authorites</span>
</span>
【讨论】: