开发者

Making a UL wider than it's parent LI

I have a nav bar with dropdown menus, I would l开发者_开发百科ike the dropdown menus to stretch to whatever width necessary for the content inside it, but they will only go as wide as their parent element

I've read quite a bit on this, and most people suggest setting position:absolute on the dropdown menus. I've already done this and it doesn't effect it

My jsFiddle is here: http://jsfiddle.net/Rqgh6/

Does anyone know how I can get it the dropdowns to go wider than their parent element?


You can simply add white-space:nowrap; to the <a> elements:

.menu ul a {font-size:12px;padding:0 10px;line-height:22px;text-align:left; white-space:nowrap;}

Updated jsFiddle.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜