如何中心一个wrapper-div而不是内容 [英] How to center a wrapper-div and not the content
本文介绍了如何中心一个wrapper-div而不是内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望我的网页总是在浏览器中央,而不会影响内容(如align-text:center; do)。
I want my page to always be centered in the browser without affecting the content( like align-text: center; does). I want to center my wrapper-div.. How do I do this?
简化现有页面:
<div id="wrapper">
<div id="header">
Music Heaven
</div>
<div id="topmeny">
</div>
<div id="menu">
</div>
<div id="content">
</div>
<div id="bottom">
SiteAdmin
</div>
</div>
整个小提琴: http://jsfiddle.net/EndQb/
推荐答案
#wrapper {
width: ...
margin: 0 auto;
}
不需要设置text-align
no need to set text-align
这篇关于如何中心一个wrapper-div而不是内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文