Using <asp:label font-size=16px...> ist not showing size in FireFox Browser

A

Andreas Klemt

Hello,

when I use
<asp:label font-size="16px" text="Hello World" runat="server" />

and run FireFox Browser the output of "Hello World" is not in Size 16px.
The size will be ignored and I can not find it in the HTML Source Code.

Why is it a problem with FireFox and what is the solution how to set sizes
in Labels?

Thanks for any help in advance
Andreas
 
F

Fredrik Elestedt

Could you give the HTML code?

I would use CSS instead of setting individual parameters.

// Fredrik
 
T

theill

It should work fine with FireFox as well. The generated output of your
label above is:

<span style="font-size:16px;">Hello World</span>

Make sure you don't hide the control somewhere in your code - or that a
stylesheet overrides the text.

Rgd,
Peter Theill
 
A

Andreas Klemt

Hello Peter,

thanks for you reply. But it doesn't work.
Please try this:
<asp:label id="lblTest" font-size="16px" color="red" text="Hello World"
runat="server" />

The output in the FireFox Browser is:
<style id="lblTest"><font color="red">Hello World</font></span>

Why is the font-size missing?

Thanks for you help and any solutions in advance!
Andreas
 
P

Peter Theill

I'm getting this output:

<span id="ctl00_ContentPlaceHolder1_lblTest" color="red"
style="font-size:16px;">Hello World</span>

However I have to admit I'm using a beta version of VS.NET 2005 so I
can't say they haven't fixed a bug. However try to set the "style"
attrbute explicitly on your label. That ought to do it:

<asp:label id="lblTest" style="font-size: 16px; color: red"
text="Hellow World" runat="server" />

Rgd,
Peter Theill
 
A

Andreas Klemt

Hello Peter,
yes you are right. I tried it with VS.NET 2005 and there it works fine but
unfortunatly not with VS.NET 2003.

Kind Regards
Andreas
 
P

Peter Theill

Ok - as a work around you should be able to set the size on the style
e.g. using this CSS in your "<head></head>" section.

<style type="text/css">
#lblTest {
font-size: 16px;
}
</style>

Rgd,
Peter Theill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top