jQuery in Action, 2nd edition*
The moose likes HTML, CSS and JavaScript and the fly likes Paragraph rendered correctly in IE but not Firefox? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Paragraph rendered correctly in IE but not Firefox?" Watch "Paragraph rendered correctly in IE but not Firefox?" New topic
Author

Paragraph rendered correctly in IE but not Firefox?

C Brown
Greenhorn

Joined: Jun 24, 2009
Posts: 16

I'm using javascript to create a div that contains a paragraph which contains a long string. IE automatically wraps the contents, but Firefox displays the paragraph on one line. When I write it out in HTML it works in both browsers (like it should I assume because as far as I know the browser automatically wraps the contents of a paragraph). Is there something I'm missing when I use javascript? Thanks in advance.

Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Have you set the wrap css rules?

word-wrap

Eric
C Brown
Greenhorn

Joined: Jun 24, 2009
Posts: 16

I'm sorry, I guess the text I entered was not a good example of what the actually text is. The text contains spaces so it should automatically break at a space when needed... right?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61063
    
  66

Use Firebug to observe what's really getting created in the DOM. That might give you clues as to what's going on.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
C Brown
Greenhorn

Joined: Jun 24, 2009
Posts: 16

Thanks for your response, I have been using firebug and I think everything looks okay. I just created a test page that uses javascript to create the div and paragraph and everything works, so there must be something wrong with my code (the part that I didn't post).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Paragraph rendered correctly in IE but not Firefox?