css - 没有标题图像重叠的广告横幅的绝对定位

标签 css positioning banner graphical-logo

我正在开发一个使用旧版 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/

相关文章:

html - Twitter登录按钮如何具有44像素的高度

javascript - Bootstrap 模态和 Django

html - 如何让内部div使用窗口滚动条?

CSS:如何摆脱移动元素留下的空间?

ios - Swift:在删除之前将 View (用于应用内通知)动画显示到屏幕上几秒钟

javascript - 使用 Bootstrap 设计 phoneGap 应用程序的像素或百分比?

html - 将元素定位在 div 底部

css - Position Fixed with Position Relative 位置固定

swift - 当 iAd 横幅出现时,如何将 View 内容向上移动? (以 Swift 编程方式)

html - 添加全宽横幅并使其 Bootstrap 响应