Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Easy question: centering text within a label

Status
Not open for further replies.

KingRichard3

Programmer
Feb 9, 2005
58
US
I have a ASP.NET label on a web page:
Code:
<P align="center"><asp:label id="lblFeedbackToUser" runat="server" ForeColor="Red" Font-Bold="True"></asp:label></p>
I need to center the (dynamically generated) text within the label.

How do I do that, please?
Thanks,
Rick
 
this is what works for a text box...so it may work the same for a label..

Code:
style="TEXT-ALIGN: center"
 
A quick way would be to just wrap center tags around it. e.g.
Code:
Label1.Text = "<center>MyText</center>"

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top