Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't break long string in FireFox 1

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hello,

I've got a long string which in IE breaks fine at its own desired spot.

However in FF it overflows its containing element (li)

Now i've tried word-wrap, break-word, attributes but nothing seems to work?

So what am I missing?

Thanks 1DMF

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
here you go...

Code:
<li><b>&lt;a href="[URL unfurl="true"]http://www.independentmortgagenetwork.co.uk/cgi-bin/lead.pl<em>?AFID=0</em>"&gt;Independent[/URL] Mortgage Network - Mortgages, Insurnace &amp; Loans&lt;/a&gt;</b></li>

CSS...
Code:
li {
    padding:10px 0;
    break-word:break-all;
    word-wrap:break-word;
}




"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
You're not missing anything. word-wrap is a CSS3 attribute and FF does not implement it yet. IE has had it for a while as a IE proprietary attribute (like filter) but now it's made its way into the CSS3 proposal.

I agree that it is annoying that FF does not implement this, but at this point there is nothing (css & html wise) that you can do about it. I would suggest:

1. Using a scripting language (either server or client side) to split the string at a certain point or,
2. Finding a way around putting the long string on the website in the first place. I myself rarely find the need to put long strings on my sites. Why would I spell out the URL if a user can simply click on it. I don't expect anyone would actually want to highlight and copy it (or see it printed on the screen). And if they want to copy the link, they can still do it.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
grrrr, another point to IE over FF :) -lol

I need to dispay it, because it's an example of an affiliate link for the account user to copy paste and if you put a space in anywhere it wouldn't work.

I guess I could use a <textarea> tag, not ideal though, i even tried the W3Schools
Code:
document.getElementById('myid').style.wordWrap='break-word';

but that didn't work either, but hey it's just the JS DOM way of setting the CSS property, so why should it!

in the end I added a space by the = it looks ugly in FF , but that's FF's fault not mine! :p

Well at least I know it wasn't me going mad, but yet another annoying bug / limitation to contend with.

Thanks Vragabond

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Have you thought of a similar solution Google Maps uses to provide you with the link to the map you're currently looking at? It is also a long URL but they solve it so elegantly.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
no , do share, though I opted for another solution.

I made the margin/padding for the indent on the ol/ul/li so it does fit ok.

but still interested, do i just go to maps.goggle ?



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Yup, maps.google.com, search for something than click the link "Link to this page" in the top right corner.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
hmm not impressed it's a floating div with an input field not big enough to display the full URL, I want the url visible.

I guess it works for their purpose but it's not what I'm looking for.

Thanks anyhow, I guess the reduced margin will have to do (i could always reduce font size as well as a last resort)

dunno, i'll have a play, but how ever i fix it , it must be fully visible, readable and copy/paste able!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
1DMF said:
I want the url visible.
As you wish. It is funny to me as I can't imagine needing URL to ever be visible. I don't expect my users to use pen and paper to write the url off the page and everything else is actually quicker than selecting, copying and pasting (the google method with its preselected text field or the right click on the link). Anyway, good luck with tackling this one.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
It is funny to me as I can't imagine needing URL to ever be visible

because it's a visible example of how they can use their affiliate code.

it's not a link to be clicked and it is only for copy/pasting IF they want to use the link to land on the page in the example, if not they need to see how do build the link and then adapt it accordingly for their particular use.

Does that make it clearer?

I actual solved the problem by using a shorter landing page name, so it now breaks ok in FF and I didn't need to add any extra spacing, it looks the same in IE & FF now :)

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top