我已阅读多篇文章,我按照说明操作,仍然没有任何变化。我后面的是删除hr标签和我的表单之间的空间。我想通过设置margin
和padding
到0
会做修正,而不是我得到这个:CSS-删除hr标签空间不起作用
而是我想下面类似的图像 - 只是在分离领域的线。
HTML
<label for="Fridss" class="label"> F </label>
<button type="button" id="add" name="add" class="btn btn-default addButton" onClick="addInput('dynamicInput');">
<span class="glyphicon glyphicon-plus"></span>
</button>
<input type="text" name="Fridss" id="Fri" class="open_hours" placeholder="--:--" required tabindex="16">
<span>-</span>
<input type="text" name="Fridss" id="Friday" class="open_hours" placeholder="--:--" required tabindex="17">
<hr />
CSS
hr {
padding: 0;
margin: 0;
width: 400px;
border-top: 1px dotted #58585b;
}
.open_hours {
padding: 0;
margin: 0;
border-radius: 5px;
width: 20%;
height: 25px;
}
或者是有创造的CSS行的更好的方法。
可以请你分享的jsfiddle在这里我们可以调试的实际问题 – satya
我已检查您的代码 https://jsfiddle.net/95tcdeuu/ 一切正常,也许你有一些以外的CSS,影响hr margin或填充,你可以使用浏览器检查元素来找到它在哪里 –
哪个浏览器你正在用吗? –