【发布时间】:2012-03-25 17:25:07
【问题描述】:
我的网站有一个包含三个背景图像的包装器。一个静态的顶部和底部图像以及沿 y 轴重复的第三个图像。由于某种原因,顶部背景图像被切断,我无法弄清楚。
这里是直播网站的链接:http://storrepictures.weebly.com/projects.html
我已经偏移了顶部和底部的图像,这样你就可以看到它们的样子。可以看到最上面的那个被剪掉了。我试过弄乱一些 div 填充设置,但似乎无法让它工作。
一个有趣的提示:背景图像曾经是 JPEG(我切换到 PNG 文件,因为我需要透明度)。当我使用 JPEG 时,这不是问题 - 三张图像完美排列。
让我知道发布实际代码是否会有所帮助。从我在这个论坛上看到的内容来看,人们似乎喜欢看现场直播,我不想让帖子太长。
非常感谢您的帮助。
*这是 CSS:
body {
background: #ffffff;
font-family: Tahoma, arial, sans-serif;
font-size:12px;
color:#666666;
margin: 0;
padding: 0;
}
#wrapper {
background: url(containerbg.png) center repeat-y;
}
#wrappertop{
background: url(containertop.png) no-repeat;
background-position: 0px -40px;
}
#wrappertbtm{
background: url(containerbtm.png) no-repeat;
background-position: 34px 480px;
padding-bottom: 65px;
}
.title{
width: 1022px;
min-height: 30px;
_height: 30px;
padding: 10px 0px 10px 0px;
font-size: 30px;
}
.title, .title a {
color: #fff;
}
#container {
width: 100%;
position: relative;
top: 125px;
bottom: 0px;
margin: 0px;
padding: -300px 0px 0px 0px;
}
#content{
width: 800px;
min-height: 500px;
_height: 500px;
margin: 0pt auto;
}
#content a{
color: #ff6633;
text-decoration: none;
}
.weebly_header{
background: url(%%HEADERIMG%%) no-repeat;
}
这是 HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{title}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--[if lt IE 7]>
<style>
#content
{
height:400px !important;
}
</style>
<![endif]-->
</head>
<body class="wsite-theme-light">
<div id="wrapper">
<div id="wrappertop">
<div id="wrappertbtm">
<div id="container">
<div id="header">
<div id="headerleft">{logo max-height="60"}</div>
<div id="navigation">{menu}</div>
</div>
<div id="content">{content}
<div id="footer">{footer}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
【问题讨论】:
-
仔细看图片内容,底部图片似乎适合顶部,反之亦然。
-
你指的是身体背景图片吗?我实际上不认为这些图像导致了问题。我最终删除了它们并用纯白色背景替换以简化现在的事情。我也删减了代码。
标签: css image background position