/    Sign up×
Community /Pin to ProfileBookmark

CSS dropdown auto width

This seems like something I should know, but I can’t find it anywhere.

How can I get the width of the dropdown ul to be as wide enough so that the anchor links don’t wrap? In the attached screenshot you can see Health & Wellness wraps.

Here’s the markup I am using:

[code]
<ul>
<li><a href=”#”>Live</a>
<ul>
<li><a href=”#”>Real Estate</a></li>
<li>…</li>
…..
</ul>
</li>
</ul>
[/code]

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@KorDec 23.2011 — You may, probably use the [B]display:inline-block[/B] for the UL element
×

Success!

Help @aj_nsc spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...