zomboble
zomboble

Reputation: 833

expand the width of a ul if the text overflows

Is it possible to expand a ul li ul (drop down) if the text of ul li ul li goes outside the width of the box?

jsfiddle: http://jsfiddle.net/KAVzf/1/

Thanks :-)

Upvotes: 2

Views: 708

Answers (2)

My Head Hurts
My Head Hurts

Reputation: 37665

Remove all references to width: 100% from your menu (#midwrap #nav li ul, #midwrap #nav li ul li, #midwrap #nav li ul li a)

Working example: http://jsfiddle.net/KAVzf/13/

Update

To resolve the issue with only the text being highlighted in the sub-menu on hover you need to add the following CSS to #midwrap #nav li ul li:

#midwrap #nav li ul li {
    ...
    float: none;
    display: block;
    ...
} 

Working example: http://jsfiddle.net/KAVzf/22/

Upvotes: 4

Narendra
Narendra

Reputation: 3117

Check this

http://jsfiddle.net/KAVzf/14/

Remove width 100% from #midwrap #nav li ul li {} and #midwrap #nav li ul {}

Have width 100% for anchors only.

Upvotes: 1

Related Questions