input前后加伪元素不展示
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
.item>span:nth-of-type(2) {
width: 80px;
line-height: 40px;
display: inline-block;
text-align-last: justify;
}
.item>input:before{
content: ":";
height: 40px;
}
</style>
</head>
<body>
<div class="item">
<span>*</span>
<span>邮箱</span>
<!-- <span>:</span> -->
<input type="text" />
<span></span>
</div>
<div class="item">
<span>*</span>
<span>身份证号</span>
<!-- <span>:</span> -->
<input type="text" />
<span></span>
</div>
<div class="item">
<span>*</span>
<span>身份</span>
<!-- <span>:</span> -->
<input type="text" />
<span></span>
</div>
</body>
</html>
这样加了之后不展示,是input标签无法添加伪元素吗,关于伪元素添加默认是在其父级元素的子元素最后一个after,和第一个before添加,有办法可以添加到第二个元素后吗,比如说
<div class="item">
<span>*</span>
<span>邮箱</span>
<input type="text" />
<span></span>
</div>
想把伪元素添加在
<span>邮箱</span>
<input type="text" />
之间,该怎么操作呢
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星