SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot Bruce Lee's Avatar
    Join Date
    Jan 2005
    Location
    Singapore
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem with long links

    iam using long links.
    these long links make the layout to go out of design as they expand the column width.
    is there a way that i can break this link and take it to the next line.
    Happy Coding!!!
    Bruce Lee.

  2. #2
    Winemaster bronze trophy BonRouge's Avatar
    Join Date
    Oct 2004
    Location
    Sendai, Japan
    Posts
    2,417
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not being funny, but can you make the links shorter? Maybe you could use tinyurl.com...

  3. #3
    SitePoint Zealot jonboi's Avatar
    Join Date
    Apr 2005
    Location
    Preston suburbs, Lancs, UK
    Posts
    115
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    //EDIT ah forget it i just tried my own suggestion, just goes to show what a noob a am - LOL. It works with <p> so maybe i dunno ill shut up.//

    style="width:***px"

    Last edited by jonboi; Jun 9, 2005 at 17:36.
    Shine on you crazy diamond.
    Jon's boring blog about nothing.

  4. #4
    SitePoint Evangelist j0n's Avatar
    Join Date
    Apr 2003
    Location
    uk
    Posts
    546
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you are coding the html yourself then canít you just use shorter anchor text? If not, then there are ways around it. Vbulletin has a built in feature that detects if the link is over X characters long, and if it is it replaces some of the middle characters in the anchor text with dots.

    Example:
    http://www.thisisareallyreallyreally...okingkills.com

    I hope that helps,
    Jon

  5. #5
    SitePoint Zealot Bruce Lee's Avatar
    Join Date
    Jan 2005
    Location
    Singapore
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no the links r dynamic and i cannot even show .... after certain length.
    is there a way i can show them taking to next line instead of expanding the cell.
    Happy Coding!!!
    Bruce Lee.

  6. #6
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
    <html>
     <head>
      <title>links</title>
      <script type="text/javascript">
       window.onload = function(){
        var i = document.links.length, linkText;
        while(i--){
         linkText = document.links[i].innerHTML;
         linkText = linkText.replace(/(\.|\/|\?|&amp;)/g, "$1<wbr>");
         document.links[i].innerHTML = linkText;
        }
       }
      </script>
     </head>
     <body>
      <p><a href="#">http://www.example.org/foo/bar/baz/grunt/quux?foo=bar&amp;baz=grunt</a></p>
     </body>
    </html>
    The <wbr> element in nonstandard. You could use the soft hyphen instead, but Firefox doesn't support it for some reason.

    innerHTML will be defined in HTML5 and works in most browsers for HTML, and also works in Firefox1.1 and Opera8 for XML.
    Simon Pieters


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •