views:

215

answers:

2

Hi,

is there a way to "word break" a long http address in iphone safari?

Currently with a long http address: i.e. h t t p://long/website/address/to/be/displayed/on/iphone/safari

safari will render it in one line, thus affecting the page and the other contents where user has to scroll horizontally now.

is there a way for safari to display:

http://long/website/address/to/
be/displayed/on/iphone/safari
?

Maybe css keyword similar to word-break in IE ?

+1  A: 

Add in "Hair Spaces" after each /. A hair space will not be visible on the screen, but can and will be used by Safari as potential wrapping points. The net effect is exactly what you asked for.

To do so:

1) Your page must be interpreted as UTF-8 character set.

2) Change every / to be /&x200A; -- that way the break will be after the /. Do the substitution on all of the /'s. Safari will choose the best ones for the wrapping.

See http://www.unicode.org/unicode/reports/tr14/tr14-17.html for more on line breaking characters.

Larry

Larry K
A: 

I use a { word-break: break-word; } so the browser can break it into new line.