Asp:Label Problem

  • Thread starter Thread starter Shapper
  • Start date Start date
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
 
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.
 
Are you using the CssClass in the label to specify your CSS?
For borders and co use the properties of the label.
Patrick
 
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

Back
Top