/    Sign up×
Community /Pin to ProfileBookmark

Div Box to the Size of text

I was wondering if anyone would know how to make a div box spread to the size of the text in IE and FF.

[URL=http://www.gslc.qld.edu.au/Newpage/GSLC(CSSMenu)/index.htm]Click Here[/URL] for my site.

I want the menu system boxs to be the same size as the text that they contain.

Thanks for any help.

Wofen

to post a comment
CSS

5 Comments(s)

Copy linkTweet thisAlerts:
@deep_dhyaniAug 02.2005 — hallo

try this div tag, may be it help you.

<div style="background:#ccffcc;width:1px;">1234545</div>

Best regards

Deep Dhyani
Copy linkTweet thisAlerts:
@WofenauthorAug 02.2005 — The only problem with that Div is that if you have a space in the line, it places the text onto 2 lines. I want the div to be the total size of the text, but everything has to be on one line, as it is a menu system.

Wofen
Copy linkTweet thisAlerts:
@KravvitzAug 02.2005 — &lt;div style="background:#ccffcc;float:left;width:auto;"&gt;1234545&lt;/div&gt;
Copy linkTweet thisAlerts:
@WofenauthorAug 03.2005 — I cant believe it was auto.... I feel dump now. Very dumb, like dumber then homer.

Oh well, we all get that.

[CODE]<div style="background:#ccffcc;float:left;width:auto;">123 4545</div>[/CODE]
= 123

4545

ok, now I remember why auto did not work, it works well In FF, but in IE it moves things to 2 lines.

Wofen
Copy linkTweet thisAlerts:
@KravvitzAug 03.2005 — It's not width:auto alone that did it. The float:left is part of it.
×

Success!

Help @Wofen 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 5.28,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...