CSS菜单栏跨页宽 [英] CSS menu bar to span page width

查看:106
本文介绍了CSS菜单栏跨页宽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要从此页面的主菜单 http://www2.gardencomedyclub.co.uk 使用页面的整个宽度。我尝试在 #menu css标签中的不同位置使用 margin:0 auto; 合理。我只是想让 li 元素之间的边距扩展以填充 #mainmenu div的全部宽度。
感谢任何帮助!

I'd like the main menu from this page http://www2.gardencomedyclub.co.uk to use the entire width of the page. I've tried using margin: 0 auto; in varying places in the #menu css tags but it keeps being left justified. I'd just like the margin between the li elements to expand to fill the full width of the #mainmenu div. Thanks for any help!

推荐答案

从#menu li remove float:left并改为使用display:inline-块。这将推动最后一行在一个新的行。为了解决这个问题,你必须改变a的边距和边距:0 1px和padding:0 1px。这在IE9,FF4.01,GG11,AF5.0.5和Opera 11中有效。

From your #menu li remove float:left and instead use display:inline-block. This will however push the last li in a new row. To solve that, You will have to change the margin and padding for "a" as margin: 0 1px and padding: 0 1px. This works in IE9, FF4.01, GG11, AF5.0.5 and Opera 11.

这篇关于CSS菜单栏跨页宽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆