我正在开发一个使用旧版 vBulletin 消息论坛的网站。目前的设置在大多数情况下工作正常,但是,当我在移动设备中打开论坛时,我看到广告横幅 (728x90) 与 Logo 图像重叠,看起来很糟糕。当查看横幅 css 定位时,它变得更加困惑,因为顶部和右侧部分符合布局其余部分的需要。
我的基本问题是如何重做,使横幅永远不会与 Logo 图像重叠,同时仍保持必要的偏移量以适应布局的其余部分?
#container{
width: 100%;
height: 100px;
}
#logo{
width:230px;
height: 63px;
}
#advertisement{
height: 90px;
width: 728px;
position: absolute;
right:10px;
top: 7.5px;
}
<div id="container">
<div id="logo"><a href="index.php"><img src="logo.jpg" border="0" alt="Whatever" /></a></div>
<div id="advertisement"></div>
</div>
** 不是我的 CSS 或 HTML
最佳答案
我会给#container 属性“min-width: 958”,并保持 100% 的宽度。 这样,页面将始终足够宽以容纳 Logo 和广告。
关于css - 没有标题图像重叠的广告横幅的绝对定位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4661867/