CSS 清除浮动
我有一个关于 css clear float
的问题。
我的问题是,当我向所有页面声明 div{float:left;}
时,那么在某些部分,我仍然想要屏幕的一些 div 显示中心,例如 width:960px;margin :0 自动
。如何清除这个div
的浮动?
请参阅以下位置的代码: http://jsfiddle.net/37wnT/ 并在 http://jsfiddle.net/37wnT/show/
我需要 div#nav
和div#content
这两个div位于屏幕中心,但其他div仍然遵守规则float:left;
I have a question about css clear float
.
My question is when I declare div{float:left;}
to all the page, then in some part, I still want some div display center of the screen, like width:960px;margin:0 auto
. How to clear this div's
float?
see code in: http://jsfiddle.net/37wnT/ and review in http://jsfiddle.net/37wnT/show/
I need div#nav
and div#content
these two div center of the screen, but other div still obey the rule float:left;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我稍微修改了你的代码。看看吧。
I have modified your code little bit. take a look.
这是新的 jsfiddle
我不确定这是否是您想要的。
This is the new jsfiddle
I am not sure if this is what you want.