我希望页脚的宽度能够拉伸100%的页面。不过,我已经在HTML文档的主体上定义了min-width:1000px和max-width:1000px,以帮助创建流畅的布局。现在,当我创建页脚将其设置为最大/最小宽度:100%时,它不会跨越整个页面,并受限于主体上设置的最小/最大宽度。有没有一种方法将页脚的宽度设置为100%,同时将最小/最大宽度定义为1000像素的身体?为HTML和CSS代码是:页脚不会伸展到100%宽度
HTML:
<!doctype html>
<html lang="en">
<head>
Some Text
</head>
<body>
<header>
Some Text
</header>
<section class="mainSection">
<article class="mainArticle">
<header>
<h4>Some Text</h4>
</header>
<p>
Some text
</p>
</article>
</section>
<footer>
<section class="footerSection">
<article class="footerArticle">
<p>Some Text</p>
</article>
</section>
</footer>
CSS:
body{
margin:0px auto;
min-width:1000px;
max-width:1000px;
height:auto;
background-color: #97cdcd;
background-size: 5px 5px;
background-image: linear-gradient(rgba(189, 204, 211, .50) 50%, transparent 50%, transparent);
background-image: -webkit-linear-gradient(rgba(189, 204, 211, .50) 50%, transparent 50%, transparent);
background-image: -moz-linear-gradient(rgba(189, 204, 211, .50) 50%, transparent 50%, transparent);
}
body > footer{
margin:0px;
padding:0px;
min-width:100%;
max-width:100%;
background:#ffffff;
height:auto;
}