<div class="wrapper">
<div class="header">
<img id="back" />
<img id="front" />
</div>
<div class="body">
...
</div>
<div class="footer">
...
</div>
</div>
<style type="text/css">
.wrapper {
margin-left: auto;
margin-right: auto;
margin-top: -8px;
width: 1024px;
height: 1500px;
background-color: #CCC;
border: 1px solid;
/*display: run-in;*/
/*position:fixed;*/
text-align: center;
}
.header {
background-color: #FFC;
/*margin: 0 auto;*/
height: 150px;
width: 1000px;
display: box;
z-index: 10;
text-align:center;
vertical-align:middle;
position: fixed;
display:block;
}
#back {
position: relative;
width: 100%;
}
#front{
position: relative;
z-index: 10;
}
我需要将标题固定在页面顶部(包装器是固定宽度),包装器内部的图像在标题内部水平和垂直居中。如何做到这一点?
OK 澄清 Wrapper 是固定宽度。页眉应贴在页面顶部(包装器内部)并包含两张图片/图像。图像应相互重叠,并在标题内垂直和水平居中。希望我现在足够精确。