gpt4 book ai didi

html - 我需要将我创建的这个标签放在/或紧挨着文本框。有什么想法吗?

转载 作者:行者123 更新时间:2023-11-28 10:40:20 25 4
gpt4 key购买 nike

我有以下代码,现在我一直在研究如何将标签放在文本框内/旁边,以提供 1 个元素的感知:

HTML

<div style="position: relative; float: left;  margin-left: 12px;">
<input type="text" class="theInput" />
<label class="theLabel">$ &nbsp; |</label>
</div>

CSS

.theInput {
-webkit-appearance: none;
-moz-appearance: none;
text-overflow: ellipsis;
color: #333333;
outline: none;
border: 1px solid #E4EBED;
border-radius: 3px;
width: 70px;
height: 32px;
line-height: 25px;
font-size: 16px;
vertical-align: middle;
background-color: #fff;
padding-left:45px;

}


.theLabel {
position:absolute;
z-index:999;
-webkit-appearance: none;
-moz-appearance: none;
color: #333333;
outline: none;
width: 34px;
height: 32px;
line-height: 30px;
font-size: 20px;
background-color: #fff;
margin-left:-106px;
font-weight: bold;
cursor:default;
}

这是所需的:final result

最佳答案

这里的例子:

http://jsfiddle.net/d5ca4z88/

你应该像这样使用 label 标签:

<label>Label Name: <input type="text" class="theInput"></label>

关于html - 我需要将我创建的这个标签放在/或紧挨着文本框。有什么想法吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33518186/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com