gpt4 book ai didi

css - 删除标题和正文之间的空白

转载 作者:行者123 更新时间:2023-11-28 15:38:45 27 4
gpt4 key购买 nike

我已尝试删除页眉和正文之间的空白区域,但无法正常工作。我已经包含了一个显示我的代码的片段。任何人都知道如何排序?

header {
width: 100%;
height: 10em;
background-color: #345cd7;
position: relative;
margin: 0;
padding: 0;
}


.top-box {
background-color: #345cd7;
margin: 0;
padding: 0;
}
<body>
<header>
<img src="images/white.svg" id="logo" />
</header>
<div class="top-box">
<h1>Welcome to</h1>
<h2>Welcome to the family. Download one of the apps and get making them calls!</h2>
</div>
</body>

最佳答案

只需在您的 h1 标签中设置 margin:0

header {
width: 100%;
height: 10em;
background-color: #345cd7;
position: relative;
margin: 0;
padding: 0;
}


.top-box {
background-color: #345cd7;
margin: 0;
padding: 0;
}
.top-box h1{
margin:0;
}
<header>
<img src="images/white.svg" id="logo" />
</header>
<body>
<div class="top-box">
<h1>Welcome to</h1>
<h2>Welcome to the family. Download one of the apps and get making them calls!</h2>
</div>
</body>

关于css - 删除标题和正文之间的空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43802921/

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