我有一个带有页眉、页脚和文章标签的简单页面。http://jsfiddle.net/6fmxv/
HTML:
<header>
<div class="social">
<a class="facebook-logo" href="http://www.facebook.com/">
<div id="facebook"></div>
</a>
<a class="youtube-logo" href="http://www.youtube.com/">
<div id="youtube"></div>
</a>
<a class="twitter-logo" href="http://www.twitter.com/">
<div id="twitter"></div>
</a>
</div>
</header>
<article>
<div>Question: Who are you?</div>
</article>
<footer>
<div>
<span></span>
<div>
</footer>
CSS:
html, body {
height: 100%;
margin: 0;
}
header {
height: 24px;
background-color: rgb(19, 147, 107);
}
header .social {
padding-left: 19%;
}
header .social > a > div, footer > div > span {
margin: 0 12px;
float: left;
height: 71px;
width: 50px;
background-image: url(sprites.png);
}
header .social > a > div#facebook {
background-position: -116px -141px;
}
header .social > a > div#youtube {
background-position: -62px -141px;
}
header .social > a > div#twitter {
background-position: -9px -141px;
}
article {
width: 300px;
min-height: 100%;
margin: 0 auto;
}
article > div {
font-size: 3em;
padding-bottom: 150px;
}
footer {
background-color: black;
height: 150px;
position: relative;
margin-top: -150px; /* negative value of footer height */
clear: both;
}
footer > div > span {
background-position: 147px -138px;
height: 133px;
width: 138px;
}
我正在尝试使其流畅,例如:
- 标题粘在顶部完成
- 底部页脚 完成
- 即使调整浏览器窗口的大小,也没有滚动条。尚未完成
- 页面中心的文章(一行)。尚未完成
请建议,在这种情况下如何使文本居中并使页面流畅(没有垂直滚动条)。