Asp:Label Problem

S

Shapper

Hello,

I have an Asp:Label which CSS class is "style":

..style
{
border-color: #303030;
border-style: solid;
border-width: 1px;
display: block;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
font-weight: normal;
margin: 10px;
padding: 10px;
text-align: center;
text-decoration: none;
text-indent: 0px;
}

Only the "display:block", "margin" and "padding" are applied to the
label. The text and border styles are no applied.

I tried with asp:textbox and same thing happens.

I am using:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

It works if I use:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

The problem is I need to use the first one.
Can somebody explain to me what is going on here?

Thanks,
Miguel
 
K

Klaus H. Probst

The HTML 4.x is IE's "quirks mode". It's sloppy. By using the XHTML DOCTYPE
you're telling it that it should use a set of different "rules" to parse
your markup and apply styles to it. That's why you're seeing different
results.
 
P

Patrick Olurotimi Ige

Are you using the CssClass in the label to specify your CSS?
For borders and co use the properties of the label.
Patrick
 
S

Shapper

Yes.

Something like <asp:label id="mylabel" runat="server" cssclass="myclass"
....

Thanks,
Miguel
 

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,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top