开发者

How to get WordPress Twenty Ten theme sub-menus to expand to their contents (CSS)?

开发者 https://www.devze.com 2022-12-28 23:08 出处:网络
Hope this isn\'t \"too\" niche, because the CSS involved likely applies in other spots. I\'m working with the new Twenty Ten theme in WordPress 3 beta/nightlies, and I\'d really like it if the drop-

Hope this isn't "too" niche, because the CSS involved likely applies in other spots.

I'm working with the new Twenty Ten theme in WordPress 3 beta/nightlies, and I'd really like it if the drop-down sub-menus (Pages/custom menus) would expand to the width of whatever is in them, rather than wrap the items at 130px.

Here's an example page set up that contains nothi开发者_JAVA技巧ng but the relevant HTML and the Twenty Ten theme CSS file: http://almostexciting.com/wordpress-twentyten-menu.html

I've tried changing the "width" for the link items to a "min-width", which doesn't work - nor does completely removing it. I can't seem to locate any other styles that are constricting the width of the menu items, so I'm a bit desperate for help.

Been tearing this thing up in Firebug for too long now.


Remove the defined width for your links.

Add this:

#access ul ul a {white-space: nowrap;}

And this:

#access .menu-header ul, div.menu ul {background-color: #333;}
0

精彩评论

暂无评论...
验证码 换一张
取 消