【发布时间】:2012-10-24 22:59:38
【问题描述】:
好的,所以我在页面中有一个部分(wordpress)
<header id="masthead" role="banner">
<div id="header_fix"></div>
</header>
和css
#masthead {
width: 100%;
margin-left: auto;
margin-right: auto;
background-repeat:no-repeat;
background-size:cover;
padding: 70px 0;
}
#header_fix {
margin: 0 auto;
width: 1355px;
height: 164px;
text-align: center;
background-image:url(images/Banner_SF.png);
/*background-size: contain;*/
}
我想让 header_fix div 溢出父标题(head_fix fiv 图像是一个非常长的横幅,如 1800 像素),并且始终将 div 的中心(因此 bg-image 的中心)与中心对齐窗口。
______________________________________
| masthead always window width |
____|_____________________________________|___
| | header_fix always centered | |
|___|_____________________________________|___|
| |
|_____________________________________|
尝试了各种各样的东西......是不是和亲子关系有关? like 是 header 只是不被视为 div,或者至少需要 display:block;或者其他的东西?任何帮助表示赞赏。
【问题讨论】:
-
来吧,这对某人来说一定很容易!
标签的处理方式是否与 div(自然块)不同?
标签: css wordpress html alignment