• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Paragraph rendered correctly in IE but not Firefox?

 
C Brown
Greenhorn
Posts: 16
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you set the wrap css rules?

word-wrap

Eric
 
C Brown
Greenhorn
Posts: 16
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use Firebug to observe what's really getting created in the DOM. That might give you clues as to what's going on.
 
C Brown
Greenhorn
Posts: 16
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic