Regarding Label

J

J P Deka

How to align text in center of a ASP.NEt label.
i have given the width of label is 100% now i want the text to be placed in
center.

for Label the ASp.NEt compiler genrates HTMl tag <SPAN>
is there any property by which text can be placed in center .
 
S

Suganya

Hi,

You can align the text in the control by doing the
following:

1. Open the web form in design view
2. From the Fomat menu, select 'Build Style'to open style
builder dialog box.
3. Select text option in the left pane and select the
alignment you want from the right side.

Regards,
-Suganya.
 
M

msnews.microsoft.com

You can set the Text-Align property in a style attribute:

<asp:label id="lbTest" runat="server" style="Text-Align:center;"
width="150px">This is a test</label>

Josh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top