我有这个jsfiddle,显示我目前的代码,但它并没有为我服务。我想删除只觉我的文字需要删除文字上的边框
需要有像一些-------- -------文字
还需要整个边框顶部,底部,左侧边框右侧和背景颜色黄色应该保持不变,我知道应用边框白色会做到这一点,但我不想为文本显示白色背景。
http://jsfiddle.net/1yb6jt1k/2/
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<div class="testing">
<ul>
<li>
<label for="name">Some text but the border cuts it</label>
</li>
</ul>
</form>
</div>
</div>
.testing{
margin:50px auto;
background:transparent;
border-radius:4px;
padding:10px;
}
.testing li{
display: block;
padding: 10px;
border:1px solid #000000;
margin-bottom: 0px;
border-radius: 4px;
}
.testing li > label{
display: block;
text-align: center;
margin-top: -20px;
margin-left: auto;
margin-right: auto;
width: 40%;
color: green;
background-color: transparent;
font-size: 14px;
}
您可以尝试删除该行:边距:-20px ;.希望它会有所帮助。 –
为什么'margin-top:-20px;'? – undefined
如果没有这个边距,文本就会在li标签内部对齐......我希望它向上移动 – Sana