我希望能够让我的网站居中但不占用它周围的空间,我想要做的是让我的网站居中但是在主站点之外有一个侧箱占用空间在左边距,边距:auto;或保证金:0自动;在CSS不起作用,因为那时div占据了边缘的空间,没有任何其他的空间,并且没有浮动:中心;任何和所有帮助表示赞赏。 -Jordan 网站现在的截图: skydrive.live/redir?resid=BA174670C15415EE!111&authkey=!AAjj6qxMvhQz_IY [ ^ ]
I would like to be able to have my website centered but not take up the space around it, what I am trying to do is have my website centered but then have a side box outside of the main site that takes up the space in the left margin, the margin:auto; or margin: 0 auto; in css doesn''t work because then the div takes up the space in the margins and there is no room for anything else, and there is no float:center; Any and all help is appreciated. -Jordan Screenshot of how the site is now: skydrive.live/redir?resid=BA174670C15415EE!111&authkey=!AAjj6qxMvhQz_IY[^]
推荐答案你需要在风格中同时使用auto: You need to use both auto in the style: margin-left:auto; margin-right:auto;
这有点违反直觉,但工作正常。
更多推荐
需要div对齐方面的帮助
发布评论