Forum Moderators: not2easy

Message Too Old, No Replies

setting width from a text string

         

danny

2:39 pm on May 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is there any way in CSS to set an element's width from that of a particular text string? Using tables this can be done by setting e.g. <TABLE WIDTH="10"> and then forcibly expanding the table width by putting the the string inside <NOBR> tags and/or making it one token with &nbsp;s. But I can't see any way to do this with CSS.

BlobFisk

2:46 pm on May 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the text is within a layer and don't specify a width on the <div>, then the layer will behave similarly to a table in that it will stretch to fit the content it holds.

danny

12:03 am on May 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The problem is that I don't want the DIV to be too wide -- I want it just the width of the "standard" text I have -- and the other content in it is a lot of text that has to wrap at the right point.