我抓我的头就是为什么我需要把背景图像不会在顶部位置离开
填充顶:1px的; 在#pageHeader标识符下,以在左上角设置背景图像设置在#container,否则它从顶部显示几个像素。
即使我把填充顶:0;它不起作用。
此外,它也可以工作,如果我把它放在#intro或者我删除页面头div内的h1标签。
我的CSS文件
html
{
margin: 0;
padding: 0;
}
body
{
font: 75% georgia, sans-serif;
line-height: 1.95;
color: #555753;
background: #fff url(../images/bottom.gif) no-repeat bottom right;
margin: 0;
padding: 0;
}
#container
{
background: url(../images/bg.gif) no-repeat left top;
padding: 0 175px 0 110px;
margin: 0;
position: relative;
}
#intro
{
min-width: 470px;
width: 100%;
}
#pageHeader
{
padding-top: 1px;
height: 87px;
}
我的HTML文件看起来像
<div id="container">
<div id="intro">
<div id="pageHeader">
<h1>Hello World!</h1>
</div>
</div>
</div>
编辑~~ 它的HTML和身体..其实在我的代码,但我搞砸了编辑器,而粘贴在这里。
对不起具有默认样式的所有细节..其已经html和身体在我的代码。 –