有限保证金汽车?
我想让我的网站内容居中,但仅限于网页的特定宽度。因此,当超过 500px 时,我希望内容能够被修复,无法进一步拉伸。无论如何可以做到这一点,还是我最好把所有东西都修好?希望这是有道理的,添加一些视觉效果会更清晰一些。 谢谢!
http://i38.photobucket.com/albums/e126/aaron123456/stackflow.jpg
1.自动留出一定的空间
2.所以内容不会漂浮在较大网页的中间
I want to have the content of my website centred but only for a certain width of a webpage. So when it's over say 500px I'd want the content to then be fixed, unable to stretch any further. Is there anyway to do that, or am I best having everything fixed? Hope that makes sense ill add some visuals to be a bit clearer..
thanks!
http://i38.photobucket.com/albums/e126/aaron123456/stackflow.jpg
1.auto margin with a certain space
2.so content doesn't float in the middle of a larger webpage
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这非常简单:
#container 定义最大宽度,并且放置在其中的每个元素都居中对齐。我必须设置
width
以防止这些元素需要整个宽度。查看实际效果
It's quite simple:
#container
defines the maximum width, and every element placed inside it is aligned centered. I had to set thewidth
to prevent these elements from requiring the entire width.See it in action