【发布时间】:2014-01-30 23:31:08
【问题描述】:
我正在使用 wordpress 软件为一个政党(不是客户,我自己的目的)开发网站。我正在修改主题瘾君子称为新鲜生活的主题。其实我不是前端开发人员,但我正在尽最大努力改变与政党旗帜相匹配的主题风格。
首先,我正在修改样式的网站是www.ysrcong.com。政党旗帜网址为http://c.searchandhra.com/1/YSR%20Cong%20Flag.jpg。
我正在尝试将网页左侧的背景颜色设置为 2266BB,将网页右侧的部分设置为 0FBD60,将页面的中间部分设置为白色。网站宽度的中间部分为 950px。左右没有特定的宽度。
我用谷歌搜索并找到了一种解决方案。我实施的解决方案是,我设计了一个图像,颜色为 2266BB 和 0FBD60,宽度和高度相同,颜色为 2266BB,左侧为 2266BB,右侧为其他颜色。
我已将该图像设置为所有网页的背景。似乎在大多数浏览器中都可以正常工作,但有一些小问题。我面临的问题是
1. in ie6 seems everything was messed up. entire layout was changed.
2. in all browsers white colour was not filled with 100% in middle part of webpage. at the bottom it was left some height and that part was filled with background image
请给我建议如何解决这两个问题,以及是否有任何其他有效的解决方案来实现这一点。
按照我写的代码。
html code
-------------------------
<body>
<div id="bg"><img src="bg.png" width="100%" height="100%" alt="">
</div>
<div id="#wrapper">
webpage content goes here.
</div>
</body>
styles i applied.
---------------------------------
body {
height:100%; margin:0; padding:0;
}
html {
height:100%;
}
#bg {
position:fixed; top:0; left:0; width:100%; height:100%;
}
#wrapper {
background: #fff;
margin: 0 auto 0px auto;
padding: 10px 15px 0 15px;
width: 950px;
position:relative;
}
【问题讨论】:
标签: css image background-image stretching