Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DIV with no set width?

Status
Not open for further replies.

blasterstudios

Technical User
Dec 30, 2004
128
US
Similar to the way a TD expands when you don't specify a width, is it possible to do this with a DIV? When i don't specify a width, it automatically stretches it as wide as it can go. I want the width to work just like the height does, where it only gets larger if it needs to. Is this possible?
 
or use an inline element such as [tt]<span>[/tt].



*cLFlaVA
----------------------------
spinning-dollar-sign.gif
headbang.gif
spinning-dollar-sign.gif

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
eh, i just used another table. they work and their results are pretty consistent.

I have issues centering floating divs and SPAN usually put attributes on a "per-line" basis. The table worked fine.
 
You could always use [tt]width: auto;[/tt] which is what tables actually use. But I don't know how well IE would understand such a daunting declaration.
 
i tried that, and it still made it as wide as possible. As for the "per-line" comment, I was referring to if I set padding to text, it usually puts padding around each line of text (in result increasing the spacing between the lines) as well as if I set a background-color, it only sets it behind text, and doesn't make an actual box behind the text like a div would.

its ok though, because the table worked fine and works on all browsers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top