gpt4 book ai didi

css - 在 h1 标题上方 Bootstrap 大边距

转载 作者:太空宇宙 更新时间:2023-11-04 01:40:06 24 4
gpt4 key购买 nike

.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 的边距时,它只会变得更大。这是为什么?

enter image description here

最佳答案

When I use the inspect tool in the browser to disable the margin of the h1 it only gets bigger. Why is this?

在屏幕截图中,您看到倒数第三个框中的 h1bootstrap.css:62 了吗?

当您在位于 bootstrap.css:1224h1 上禁用边距时,将应用另一个边距。 margin: .67em 0 根据 font-size 应用顶部和底部边距,这是相当大的,所以这解释了为什么禁用另一个时边距会变大一个。

关于css - 在 h1 标题上方 Bootstrap 大边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45533868/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com