Andy
Andy

Reputation: 5091

Making a UL wider than it's parent LI

I have a nav bar with dropdown menus, I would like 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?

Upvotes: 1

Views: 3296

Answers (1)

Shadow Wizzard
Shadow Wizzard

Reputation: 66396

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.

Upvotes: 7

Related Questions