Netscape SPAN problem -- easy question

burak

Centurion
Joined
Jun 17, 2003
Messages
127
Hello and Happy Thanksgiving,

I am dynamically creating a label and assigning a
width to it.

Dim lbl3 As New Label
lbl3.Text = name
lbl3.Width = System.Web.UI.WebControls.Unit.Point(255)

This shows up as

<span style="width:255pt;">

when I do a viewsource. IE displays the width fine
but Netscape 7.1 does not preserve the width of the
span.

I copied the <browsercaps> xml in the following page

http://slingfive.com/pages/code/browserCaps/

into my web.config but it didn't solve my problem.

Do you know how can I get nescape to display the
width properly?

Thank you,

Burak
 
The "span" element is used for inline text and objects, which flow with the rest of the page's inline content. If you want to define a width and/or height, use a block-level element, such as "div".
 
You can also get a normally inline element (such as span) to be displayed as a block element by using the style/display property... however as Derek said, you would just use DIV in this case. I often will do this trick when wanting to show links in a list instead of side by side... in reality it's just a lazy way of me avoiding the break tag in my html code.
 
Back
Top