gpt4 book ai didi

css - 标题 1 和 2 之间的间隙/空间

转载 作者:太空宇宙 更新时间:2023-11-03 19:41:22 25 4
gpt4 key购买 nike

我试图将 h2 放在 h1 的正下方,但它似乎产生了巨大的间隙/空间。有没有某种方法可以避免这种情况,或者这是编码错误?谢谢。

网站链接: http://younani.com/armen/musicindex.html

HTML:

<!DOCTYPE html>
<html lang="en">
<head>

<title>Armens website</title>
<meta charset="utf-8">
</head>
<body>
<div class="clearfix" id="container">
<p><link rel="stylesheet" href="armen.css" /></p>
<h1><i>Four To The Floor</i></h1>
<h2>Artist Management &amp; Events</h2>
<p></p>
<h3>&ldquo;It&rsquo;s not where you take things from,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; it&rsquo;s where you take them to.&rdquo; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - Jean-Luc Godard</h3>
<div id="footer">
<p>Armen Sarkisian &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:fttfmusic@gmail.com">fttfmusic@gmail.com</a>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<a href="http://www.fttfmusic.com/">www.fttfmusic.com</a></p>
</div>
</div>
</body>
</html>

CSS:

h1 {color: #FFFFFF; font-family: ballparkweiner; font-size: 70px;
text-align: center; }

@font-face {
font-family: 'ballparkweiner';
src: url('ballw___.eot');
src: url('ballw___.eot?#iefix') format('embedded-opentype'),
url('ballw___.woff') format('woff'),
url('ballw___.ttf') format('truetype'),
url('ballw___.svg#ballparkweiner') format('svg');
font-weight: normal;
font-style: normal;

}

h2 {text-align: center; font-size: 40px; color: #FFFFFF; font-family: Cambria;}

body {background-color: #000000;}

h3 {text-align: center; color: #FFFFFF; }

#footer { font-weight: bold; text-align: center; font-family: Audimat;
clear: both; width:48%;
border-radius: 8px;
background-color:black;
text-align:center; margin-right:auto;
margin-left:auto; color: #FFFFFF; }

最佳答案

h* 浏览器中的元素往往有一些......相当大的默认顶部和底部边距。您可以将它们专门设置为一些更小的值,甚至为零:

h1, h2 {
margin-top: 0;
margin-bottom: 0;
}

您当然可以将这些规则应用于您的特定 header 。

关于css - 标题 1 和 2 之间的间隙/空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15893322/

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