p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 3.5 Basics (http://p2p.wrox.com/forumdisplay.php?f=351)
-   -   Font size of Header Text in DetailsView Control (http://p2p.wrox.com/showthread.php?t=68316)

AspNetGuy May 22nd, 2008 02:59 PM

Font size of Header Text in DetailsView Control
 
I am new to ASP.NET. I started with ASP.NET 3.5 and Imar's book.

I can not affect the DetailsView header text, though I have tried everything I can think of.

I have inserted a DetailsView control. I have set the HeaderText to "Add User". I have set the HeaderStyle:CssClass to AdminUserViewTableHeaderStyle. The style is coded as follows:

.AdminUserViewTableHeaderStyle
{
    background-color: #CC0000;
    padding: 5px;
    color: #FFF;
    font-size: 23px;
        height: 35px;
    border: 1px solid #009;
}

I have also changed the FontSize directly in the control.

All to noavail. The generated HTML is as follows:

<tr class="AdminUserViewTableHeaderStyle" style="font-size:16pt;">
            <td colspan="2">Add User</td>

As you can see the styling is for the <tr> not for the <td>.

Should the above styling affect the "Add User" text size or not?
If not is their a property in the DetailsView control that affects the TD in the header?

If not how to I change the fontsisze of the text in the header?

Thanks for any help you might provide.


Imar May 22nd, 2008 03:25 PM

Hi there,

Looks like you're missing a dot. Class selectors are always prefixed with a dot in their definition:

.AdminUserViewTableHeaderStyle
{
 ...
}

<tr class="AdminUserViewTableHeaderStyle" style="font-size:16pt;">

If that doesn't help, look at style definitions you may have for td. Maybe you're overwriting the tr settings through a selector for the td.

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.

AspNetGuy May 22nd, 2008 03:44 PM

Imar,

I am not sure where you saw a missing dot. The definition does have a dot prefix. However, your other comment sparked my memory. At the top of the stylesheet I DO have a TD definition with fontsize specified.

I added the following definition to override the earlier TD definition and all is well.

.AdminUserViewTableHeaderStyle td
{
   font-size: 18px;
}

Thanks for the memory jog.



Imar May 22nd, 2008 04:23 PM

Weird stuff. I can see the dot here on p2p, but not in my Gmail account. It also disappeared from my own reply. Strange....

Anyway, glad the td fix solved the problem.

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.


All times are GMT -4. The time now is 05:02 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.