473,324 Members | 1,646 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Asp:Label Problem

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

Nov 19 '05 #1
3 1257
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.

--
Klaus H. Probst, MVP
http://www.simulplex.net/
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:OB**************@tk2msftngp13.phx.gbl...
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

Nov 19 '05 #2
Are you using the CssClass in the label to specify your CSS?
For borders and co use the properties of the label.
Patrick

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #3
Yes.

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

Thanks,
Miguel

"Patrick Olurotimi Ige" <na********@hotmail.com> wrote in message
news:na********@hotmail.com:
Are you using the CssClass in the label to specify your CSS?
For borders and co use the properties of the label.
Patrick

*** Sent via Developersdex http://www.developersdex.com ***


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: tshad | last post by:
Is there another way to put labels on a page other than asp:label? I have been building a page where I use a label to display the calculated result of some imput. I do it using Javascript. But...
1
by: Steve Hershoff | last post by:
I'm using VS 2003, and need to extract the text from an asp label in my code-behind file. The label is part of a DataList's ItemTemplate. I've noticed that in my ascx file (we're using User...
0
by: Dhananjay | last post by:
hi all i have a problem on populating a message on asp:label server control.I am able to insert records into the table.but it is not populating any message like "Records entered successfully"....
0
by: Dhananjay | last post by:
hi all i have a problem on populating a message on asp:label server control.I am able to insert records into the table.but it is not populating any message like "Records entered successfully"....
0
by: Dhananjay | last post by:
hi all i have a problem on populating a message on asp:label server control.I am able to insert records into the table.but it is not populating any message like "Records entered successfully"....
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.