这让我抓狂!我需要这个CSS代码的帮助。我以前使用过HTML但是我需要使用CSS来进行这种布局,而我之前从未使用过它。我现在的问题是顶部标题不会与较低的图像对齐。我可以改变保证金,一切都会动作!如果我改变图片的大小,它仍然不会对齐。此外,当我调整浏览器的大小时,背景随之移动,我需要将其固定,以便“桌子”保持在其中间。你能帮忙吗?
CSS:
html {
margin: 0;
padding: 0;
}
body {
font-family:Arial, Helvetica, sans-serif;
line-height:18px;
font-size:12px;
color: #06185c;
background: #ffffff url(crysbg.png) no-repeat top center fixed;
margin: 0;
padding: 0;
position: absolute;
}
p {
margin: 10px;
padding: 0;
}
h1, h2, h3 {
display:none;
}
.page-wrapper {
margin: auto;
width:auto;
background:url(topbanner.png) no-repeat top center;
position:absolute;
margin-left: 318px;
margin-right: auto;
}
HTML:
<body id="crystal-self-acceptance">
<div class="page-wrapper">
问题图片:
http://i.imgur.com/eI8Cmns.jpg 定位问题。
i.imgur.com/3EUEYnr.jpg 调整窗口大小时,中心区域远离背景。 (这包括宽屏幕,没有截图)。
请帮忙吗?
编辑添加jsFiddle:http://jsfiddle.net/Q3y36/8/