Forum Moderators: not2easy

Message Too Old, No Replies

Triming url and span long text.

         

fischermx

6:39 am on Jun 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have to display two fields in inside a span tag, which are variable length. I need these fields to just get trimmed in case they are too long.
I'm using XHTML 1.0 Transitional.
So, I have :



<span style="width: 200px; overflow: hidden;">
<a href="very long url">very long url</a><br />
<span>very long text</span>
</span>

The effect is this :
IE, it does not trim (hide) the overflow, it wraps the url and text!
Firefox, doesn't trim, doesn't hide, does not anything.

How do I accomplish this? Any comment?

Robin_reala

3:56 pm on Jun 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



[w3.org ]
This property specifies whether content of a block-level element is clipped when it overflows the element's box.

Your <span> isn't a block-level element, it's inline. You could probably get the overflow working using display:block but you might as well just use a <div> in this case as it's a generic block level element.

fischermx

3:19 pm on Jun 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's it! Marking the a href as block works.