Avatar of PapaparaTudu
PapaparaTudu
 asked on

Breaking long links

hi,
I'm looking for a way to break long links in my page into multiple lines as currently the page gets skewed because of them. It doesn't look like HTML supports this - I tested the <pre> tag but it only seems to affect strings that contain whitespaces. Is there any way to achieve that so that it works in all these browsers: IE, Firefox, Safari, Opera?

Thanks!
CSSASP.NETHTML

Avatar of undefined
Last Comment
Karai_17

8/22/2022 - Mon
gamebits

If they are hard coded you could use a service like tinyurl I guess

http://tinyurl.com/
Badotz

You could have the link call a javascript function to load the url based on the link ID, or some such thing.
Karai_17

You could also try detecting the length of the url string using ASP.NET and formatting it so it displays something like this:
<a href="http://www.google.com/some/web/site/index.aspx">http://www.google.com/.../index.aspx</a>

Open in new window

Your help has saved me hundreds of hours of internet surfing.
fblack61
PapaparaTudu

ASKER
Karai_17: I like your solution most so far. tinyurl is not what I'm looking for. Link id seems like a  complicated idea.

Actually now I have realised that I would need this functionality not only for links, but also for simply long words. I could detect long words with ASP.NET and if they're over a certain length, I could insert a new line after that position.

Any other ideas?
ASKER CERTIFIED SOLUTION
Karai_17

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.