Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Old 11-16-2005, 09:17 AM   PM User | #1
cooldaddy
New Coder

 
Join Date: Aug 2005
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
cooldaddy is an unknown quantity at this point
word-wrap in firefox ?

I use the following div

<div id="topmenu" style="word-wrap: break-word; width: 600px; padding:12px;">

to display a large amount of text, this works perfectly within IE the lines are nicely wrapped if the exceed the width of the div. However Firefox doesn't seem to wrap it at all. Is there anything I can do so Firefox will wrap as well ?
cooldaddy is offline   Reply With Quote
Old 11-16-2005, 09:32 AM   PM User | #2
mrruben5
Regular Coder

 
Join Date: Nov 2004
Location: The Netherlands
Posts: 551
Thanks: 0
Thanked 0 Times in 0 Posts
mrruben5 is an unknown quantity at this point
No. Firefox can't. This is one of IE's better things.
__________________
CATdude about IE6: "All your box-model are belong to us"
mrruben5 is offline   Reply With Quote
Old 11-16-2005, 09:41 AM   PM User | #3
cooldaddy
New Coder

 
Join Date: Aug 2005
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
cooldaddy is an unknown quantity at this point
so there isnt an alternative for it ?
cooldaddy is offline   Reply With Quote
Old 11-16-2005, 09:44 AM   PM User | #4
mrruben5
Regular Coder

 
Join Date: Nov 2004
Location: The Netherlands
Posts: 551
Thanks: 0
Thanked 0 Times in 0 Posts
mrruben5 is an unknown quantity at this point
no... Maybe later, as it's a standard.

You can however, set you text-align to justify to get a nicer effect in FF.
__________________
CATdude about IE6: "All your box-model are belong to us"
mrruben5 is offline   Reply With Quote
Old 11-16-2005, 12:48 PM   PM User | #5
bushie
New Coder

 
Join Date: Nov 2005
Location: Australia
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
bushie is an unknown quantity at this point
Quote:
Originally Posted by mrruben5
No. Firefox can't. This is one of IE's better things.
Sorry, but I don't believe that IE has any of those "better things". They just refuse to comply with standards and introduce their own proprietary tags. Word-wrap is not a valid css 2.1 attribute and if you want your sites to work across all browsers you need to stick to the standards.

Code for FF and hack for IE!
bushie is offline   Reply With Quote
Old 04-20-2006, 11:30 AM   PM User | #6
jiffin
New to the CF scene

 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
jiffin is an unknown quantity at this point
Smile

You can try this...

pre{
white-space: pre; /* CSS2 */
white-space: -moz-pre-wrap; /* Mozilla */
white-space: -hp-pre-wrap; /* HP printers */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: pre-wrap; /* CSS 2.1 */
white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
word-wrap: break-word; /* IE */
}



{word-wrap:;} is an IE proprietary property, and not a part of css. firefox's handling is correct. Unfortunately, FF does not support a soft hyphen ­/­. so that's not an option. You could possibly insert a hair or thin space, &hairsp;/  (check me on the numeric entity) and &thinsp;/ , respectively.

Making {overflow: hidden;} would cut the overflow off, and {overflow: auto;} would cause the overflow to enable scrolling.
jiffin is offline   Reply With Quote
Old 04-20-2006, 01:48 PM   PM User | #7
ronaldb66
Senior Coder

 
Join Date: Jun 2002
Location: The Netherlands, Baarn, Ut.
Posts: 4,254
Thanks: 0
Thanked 0 Times in 0 Posts
ronaldb66 is an unknown quantity at this point
Soft hyphen

Quote:
Unfortunately, FF does not support a soft hyphen ­/*.
... which IE does, brilliantly; you have to give 'em that. An auto word break facility would be even nicer, though; the rules for breaking words aren't that complicated.
__________________
Regards,
Ronald.
ronaldvanderwijden.com
ronaldb66 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:06 PM.

Home - Contact Us - Archives - Link to CF - Resources - Top 

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.