This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes div not wrapping words Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "div not wrapping words" Watch "div not wrapping words" New topic

div not wrapping words

Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421

the above referenced code is not wrapping in the div content 2.

This is with HTML 5.0.

Also I have tried this:

white-space: pre-wrap; /* CSS3 */
white-space: -moz-pre-wrap; /* Firefox */
white-space: -pre-wrap; /* Opera <7 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* IE */

Chetan Charadva

Joined: Dec 05, 2008
Posts: 5
Use "clear: left" for "content2" div.
Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
Thanks I got rid of the floats and this did the same thing.

Thanks anyway for your advice, it is appreciated.

Thanks, Michele
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63208

It wraps fine for me when I drop that fragment into an HTML page. There must be something else applying styles to the element. I suggest loading the page into Chrome (or Forefox with Firebug) and open the dev tools to inspect the computed CSS that is applied to the element.

P.S. Applying lots of styles with the style attribute is not recommended. You should be applying those styles though a stylesheet.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
Thanks Bear! Appreciated very much,

Have you checked out Aspose?
subject: div not wrapping words
It's not a secret anymore!