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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force wordwrap inside <div></div> ?? 2

Status
Not open for further replies.

Sleidia

Technical User
Joined
May 4, 2001
Messages
1,284
Location
FR

Hi :)

How do you force wordwrap inside <div id="mydiv" style="width: 55"></div> after you have dynamically changed it's visibility ?

document.getElementById( 'mydiv' ).style.display = 'none';
document.getElementById( 'mydiv' ).style.display = '';

It seems that dynamically changing the display ruins the width property (tested on Firefox only).

Thanks !!
 
ruins the width property? how are you changing the style? i bet it's more than just with the display property. is your "myDiv" really a div? DIVs are block elements, by default. short of an answer to all of these questions, try display of 'block' instead of ''.



*cLFlaVA
----------------------------
[tt]( <P> <B>)13 * (<P> <.</B>)[/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 

Thanks again guys :)

I'll check this later since I'm too tired right now.
 
I won't sell any puppies like that.....

-kaht

Looking for a puppy?

[small]Silky Terriers are small, relatively odorless dogs that shed no fur and make great indoor pets.[/small]
 
Your width is somewhat mangled. 55 what? Percent? Pixels? Maybe centimeters? Points? How is the browser to know? Could be that IE assumes pixels and FF thinks you were too lazy to type so it will be too lazy to guess. Words wrap by default in a div. Make sure you have spaces in them and that width has properly defined width. Or else it will be 100% wide.
 
Sorry, it's just a typo in this post.
The original code says 55px.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top