【发布时间】:2020-09-11 09:43:19
【问题描述】:
是否可以在输入字段内插入元素?这是一个例子:
我可以用什么来做到这一点?
我想知道表格,可以在输入字段中创建表格吗?
.box-login {
width: 300px;
height: auto;
margin: 0 auto
}
.box-login .bots {
width: 100%;
height: auto;
margin: 0;
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radx-inpuius: 3px;
-ms-border-radius: 3px;
box-shadow: 0 0 4px rgba(0, 0, 0, .2);
box-shadow: 0 0 4px rgba(0, 0, 0, .2);
-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, .2);
-moz-box-shadow: 0 0 4px rgba(0, 0, 0, .2);
-ms-box-shadow: 0 0 4px rgba(0, 0, 0, .2);
background-color: #fff;
position: relative
}
.box-login .box-inputs .line-input {
width: 100%;
height: 50px;
padding-left: 0;
position: relative;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border-left: 0px;
border-top: 0px;
border-right: 0px;
}
.box-login .btn-login {
width: 100%;
margin: 0;
height: 50px;
color: #fff;
border-radius: 0 0 3px 3px;
-webkit-border-radius: 0 0 3px 3px;
-moz-border-radius: 0 0 3px 3px;
-ms-border-radius: 0 0 3px 3px;
background-color: #009edb;
border: none;
}
<form class="box-login">
<div class="box-inputs">
<label class="box-input" for="cpf"></label>
<input class="line-input" id="cpf" type="text" placeholder="CPF">
</div>
<div class="box-inputs">
<label for="box-input">
<input class="line-input" id="password" type="password" placeholder="Senha">
</label>
</div>
<div>
<button class="btn-login">ENTRAR</button>
</div>
</form>
【问题讨论】:
-
使用伪元素或者看起来你的输入已经被包装了你可以使用
-
谢谢@Darkrum,也许有帮助!能给我发个例子吗?
-
@epascarello 就像那张图片:prnt.sc/j7nki6,我正在寻找 ::before(CSS 伪元素)。对于测试,我在 CSS: line-input::before { content: url("loading.gif"); } 但什么也没发生
标签: javascript html css