Center Label on Page

  • Thread starter Thread starter Phillip Vong
  • Start date Start date
P

Phillip Vong

Using VS2005 / VB.NET / ASP.NET

Newbie trying to learn.

I have a simple label and I want to center this on the page, but I can not.
When I hightlight this in VS2005 and say to center it, it does nothing. How
do I hard code this to center on a pager?

<asp:Label ID="HeadingL" runat="server" Font-Size="XX-Large" Text="Summary"
ForeColor="DarkBlue"></asp:Label><br />
 
Phillip Vong said:
Using VS2005 / VB.NET / ASP.NET

Newbie trying to learn.

I have a simple label and I want to center this on the page, but I can
not. When I hightlight this in VS2005 and say to center it, it does
nothing. How do I hard code this to center on a pager?

<asp:Label ID="HeadingL" runat="server" Font-Size="XX-Large"
Text="Summary" ForeColor="DarkBlue"></asp:Label><br />



<center>

<asp:Label ID="HeadingL" runat="server" Font-Size="XX-Large" Text="Summary"
ForeColor="DarkBlue"></asp:Label><br />

</center>
 
I have a simple label and I want to center this on the page, but I can
not. When I hightlight this in VS2005 and say to center it, it does
nothing. How do I hard code this to center on a pager?

<div style="text-align:center">
<asp:Label ID="HeadingL" runat="server" Font-Size="XX-Large" Text="Summary"
ForeColor="DarkBlue"></asp:Label><br />
</div>

You shouldn't use the old <center> tag these days, as it is not
XHTML-compliant:
http://www.w3schools.com/tags/tag_center.asp
 
Back
Top