Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2005

Tip: Looking for answers? Try searching our database.

Asp:Label Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Shapper - 15 Jul 2005 00:14 GMT
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
Klaus H. Probst - 15 Jul 2005 06:31 GMT
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.

Signature

Klaus H. Probst, MVP
  http://www.simulplex.net/

> Hello,
>
[quoted text clipped - 33 lines]
> Thanks,
> Miguel
Patrick Olurotimi Ige - 15 Jul 2005 08:23 GMT
Are you using the CssClass in the label to specify your CSS?
For borders and co use the properties of the label.
Patrick
Shapper - 15 Jul 2005 09:18 GMT
Yes.

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

Thanks,
Miguel

"Patrick Olurotimi Ige" <naijacoder@hotmail.com> wrote in message
news:naijacoder@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 ***

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.