.row {background-color: pink;}
h1 {background-color: cyan;}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class='container'>
<div class='row'>
<h1>China</h1>
</div>
</div><!--end container-->
h1
标签的顶部有一个很大的边距。当我在浏览器中使用检查工具禁用 h1
的边距时,它只会变得更大。这是为什么?
最佳答案
When I use the inspect tool in the browser to disable the margin of the h1 it only gets bigger. Why is this?
在屏幕截图中,您看到倒数第三个框中的 h1
和 bootstrap.css:62
了吗?
当您在位于 bootstrap.css:1224
的 h1
上禁用边距时,将应用另一个边距。 margin: .67em 0
根据 font-size
应用顶部和底部边距,这是相当大的,所以这解释了为什么禁用另一个时边距会变大一个。
关于css - 在 h1 标题上方 Bootstrap 大边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45533868/