gpt4 book ai didi

html - 行高仅在顶部?

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

我有一个网站:http://starthumble.com/

菜单在同一页面上产生滚动到 anchor 的效果。但是,如果您单击“主页”,它会滚动并切掉一半的标注文本。我发现如果我设置

.companycallout h1 {
line-height: 5em;
}

然后它会正确滚动。唯一的问题是 h2 标签被压低了。我能找到解决方法的唯一方法是

.companycallout h1 {
line-height: 5em;
}
.companycallout h2 {
margin-top: -90px;
padding-bottom: 50px;
}

这是最好的解决方案吗?有没有更好的选择?我还没有测试过这个跨浏览器(目前无法访问它)所以我不确定它是否全面兼容。

谢谢!

最佳答案

只需将 margin-top 更改为 padding top

body {
margin: 0;
font-family: "Open Sans", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 20px;
color: #333;
background-color: white;
padding-top: 80px;}

关于html - 行高仅在顶部?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13326034/

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