我只想在右上角创建一个带有小x(关闭)按钮的输入文本字段。请帮我说明如何在css3或bootstrap 3中完成它。谢谢
答案 0 :(得分:1)
这是一个简单的demo:
HTML:
<input type="text"><span class="close-icon">x</span>
的CSS:
.close-icon{
position:relative;
left: -14px;
top: -4px;
}
答案 1 :(得分:0)
HTML
<div class="main-content">
<a href="javascript:void(0);" class="close">X</a>
Dummy Text will be here.. Dummy Text will be here..
</div>
CSS
.main-content{
border:1px solid #aaa;
height:200px;
width:50%;
position:relative;
padding:10px;
font-family: arial;
font-size:12px;
}
.close{
position: absolute;
right:5px;
top:5px;
text-decoration: none;
font-family: arial;
color:#fff;
background-color: #aaa;
padding:3px 5px
}