Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Apr 2005
    Location
    Ireland
    Posts
    122
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Mozilla Links wrapping

    Hi

    I'm dynamically displaying links to a web page.
    They are contained in a div.

    Html:

    Code:
    <div id="ans">&nbsp;[% question.q_answer %]</div>

    Css:

    Code:
    #ans {
      font-family: Verdana, sans-serif;
      font-size: 11px;
      line-height: 125%;
      border: none;
      padding: 0px 2px 5px 2px;
      margin: 0px 0px 0px 3px;
      color: #000000;
    }


    The links wrap fine with IE6, but goes way beyond the screen boundary for Firefox and Netscape when the links are very long.

    Any suggestions on how to prevent this?

    Thanks in advance

  • #2
    Regular Coder
    Join Date
    Sep 2007
    Location
    Raleigh, NC
    Posts
    273
    Thanks
    7
    Thanked 59 Times in 52 Posts
    Containers are not supposed to grow for content too big to fit them, they are supposed to flow out of the container like Firefox and Netscape do. That's the behavior outlined in the CSS spec, and IE6 actually gets it wrong.

    Really you could do one of two things: 1.) Do some massaging server-side to either cut off some of the link length with ellipses or 2.) use an overflow = hidden to hide the overflow.

    Obviously something in the realm of #1 would be a better approach.

  • Users who have thanked vtjustinb for this post:

    tom123 (10-04-2007)

  • #3
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    What's the output of the link?

    If it's one continuous stream of text (like vtjustinb describes) then what he says is the way to go.

    But if the output is supposed to be something like <div id="ans">&nbsp;View the answer of this question</div> there's always the chance that your backend is displaying non-breaking spaces (i.e., &nbsp;). I actually had something similar happen to me…it took forever to track it down and then it was just a matter of replacing the non-breaking space with a regular one.

  • #4
    Regular Coder
    Join Date
    Apr 2005
    Location
    Ireland
    Posts
    122
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thanks for your help guys.
    Yes its a continuous stream of text rmedek,
    so im going to use overflow = auto as suggested.


  •  

    Posting Permissions

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