gpt4 book ai didi

html - 为什么我的标题不显示在某些浏览器上?

转载 作者:行者123 更新时间:2023-11-28 12:49:45 25 4
gpt4 key购买 nike

在 Safari 上,以下代码非常适合显示我的横幅,但出于某种原因,横幅在所有其他浏览器上都不会显示。我已经在浏览器上使用了检查元素功能,它似乎就在那里,但它就像从来没有出现过一样。这是 header 的 HTML 和相应的 CSS。我做错了什么吗?

HTML

<div id="int-site-container">
<div id="int-site">

</div>
</div>

CSS

#int-site-container{
margin: 0;
}
#int-site{
background: url(/images/<mysite>-introbanner.png) center top no-repeat;
height:inherit;

}

最佳答案

经过多次摆弄后,我发现了横幅不显示的原因。因为我使用的是一个没有定义高度的包含 div,所以大多数浏览器不会为它创建空间,所以它只是保持 0 高度的 div。为了解决这个问题,我将包含的 div 更改为横幅图片的高度

#int-site-container{
margin: 0;
height:166px; /*this was the line I needed*/
}
#int-site{
background: url(/images/<mysite>-introbanner.png) center top no-repeat;
height:inherit;

}

关于html - 为什么我的标题不显示在某些浏览器上?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17091721/

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