【发布时间】:2015-04-04 10:02:52
【问题描述】:
我有宽度为 1000px 的标题和主容器 div 并且相对定位。在此之下,我需要一个宽度为 1300 像素的页脚,但如果我将其相对定位,它将变为 1000 像素,如果我将其定位固定,它不会在主容器下方居中。希望你能得到我的Q。 代码细节是:
.main-header {
position: relative;
margin: 0 auto;
width: 100%;
z-index: 99;
max-width: 1000px;
float: none;
display: block;
min-height:145px;
border-bottom:none;
}
.main-container {
width: 1000px;
margin: 0 auto;
overflow: hidden;
padding: 0;
background: #fff;
position: relative;
box-shadow: 0px 0px 10px rgba(50, 50, 50, 0.17);
}
.copyrights {
float:left;
width:1300px;
height:285px;
clear: both;
background: #7e8285;
padding: 0 0 0 0;
margin-top: 0px;
margin-left:auto;
margin-right:auto;
color: #d3d4d6;
font-size: 14px;
text-transform:capitalize;
position: relative;
border-top:none;
z-index:1;
}
/copyrights 是为页脚区域定义的一个类。/ 我想要页眉,主容器宽度为 1000 像素,页脚宽度为 1300 像素。
【问题讨论】:
-
请将所有相关代码发布到您的问题 (html)
-
我什至不确定要问什么以及期望的行为是什么
标签: html css header containers footer