网址:http://vixenology.com/
在标准的缩放级别,整个博客是左对齐的,右边是一个巨大的无人区。如何缩小页面的大小,使博客在所有缩放级别都居中?
我已经尝试了一些简单的css,但似乎无法弄明白。
谢谢!
发布于 2011-06-05 08:12:43
这就是你要找的:
.main-width { margin: 0px auto; }发布于 2011-06-05 08:13:40
嗯。如何将你的主要内容放在div中,并以此为中心:
margin: 0 auto;
width: /* the width of your content */不过,你必须重新排列你的html标记;我试过这样做,但它切断了你的背景。你必须把你的背景图像从你想要居中的div中拿出来,放在那个div的周围。如果这有意义的话..类似于:
<body>
<div id="bg"><!-- give this id the background-image in css -->
<div id="maincontent">
<!-- this div contains all your content, everything that needs centering -->
</div>
</div
</body>然后在你的css中:
#bg { background-image: /* blabla */ }
#maincontent { margin: 0 auto; width: /* width, as stated above */ }差不多吧。
发布于 2011-06-05 08:12:58
给换行div一个固定的宽度和一个边距:0 auto
https://stackoverflow.com/questions/6240151
复制相似问题