简体   繁体   中英

Why isn't my header showing up on certain browsers?

On Safari, the following code works perfectly for displaying my banner, but for some reason on all other browsers the banner just doesn't show up. I've used the inspect element features on the browser and it seems to be all there but it is like it was never there. Here is the HTML and corresponding CSS for the header. Am I doing something wrong?

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;

}

After much fiddling around I found out why the banner would not show up. Since I was using a containing div that didn't have a defined height, most browsers would not create space for it so it just remained a div of 0 height. To fix this, I changed the containing div to the height of my banner image

#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;

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM