Regarding Label

Discussion in 'ASP .Net Web Controls' started by J P Deka, Jul 15, 2003.

  1. J P Deka

    J P Deka Guest

    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 .
    ----
    Jyoti Prakash Deka
    NIIT Ltd.
    India
     
    J P Deka, Jul 15, 2003
    #1
    1. Advertising

  2. J P Deka

    Suganya Guest

    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.

    >-----Original Message-----
    >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 .
    >----
    >Jyoti Prakash Deka
    >NIIT Ltd.
    >India
    >
    >
    >
    >
    >.
    >
     
    Suganya, Jul 15, 2003
    #2
    1. Advertising

  3. 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

    "J P Deka" <> wrote in message
    news:%...
    > 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 .
    > ----
    > Jyoti Prakash Deka
    > NIIT Ltd.
    > India
    >
    >
    >
    >
     
    msnews.microsoft.com, Jul 15, 2003
    #3
  4. J P Deka

    J P Deka Guest

    Thanks it is working .

    ----
    Jyoti Prakash Deka
    NIIT Ltd.
    India



    "msnews.microsoft.com" <> wrote in message
    news:#...
    > 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
    >
    > "J P Deka" <> wrote in message
    > news:%...
    > > 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 .
    > > ----
    > > Jyoti Prakash Deka
    > > NIIT Ltd.
    > > India
    > >
    > >
    > >
    > >

    >
    >
     
    J P Deka, Jul 15, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shapper
    Replies:
    2
    Views:
    752
    Scott Mitchell [MVP]
    May 7, 2005
  2. Josef K.

    <label><div></div></label> allowed?

    Josef K., May 20, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    13,547
    Josef K.
    May 22, 2005
  3. Praveen
    Replies:
    1
    Views:
    1,013
    Rob Williscroft
    Nov 5, 2006
  4. CSharpner
    Replies:
    0
    Views:
    1,091
    CSharpner
    Apr 9, 2007
  5. Knut Krueger
    Replies:
    8
    Views:
    292
    Knut Krueger
    Aug 20, 2013
Loading...

Share This Page