Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to align asp.net label text in center

Tags:

css

asp.net

I have a label with in a div in ASP.NET just before a text box but I am not sure how can I center align my asp.net label,

    <div style="float: left; width: 65%;">
        <asp:Label ID="lba" CssClass="aa" runat="server" Text="aaa" />
    </div>
like image 462
Change Avatar asked Oct 25 '25 22:10

Change


2 Answers

In the div element add style text-align: center to center the text

<div style="float: left; width: 65%; text-align: center;">

like image 133
Muthu Kumaran Avatar answered Oct 28 '25 13:10

Muthu Kumaran


<div style="float: left; width: 65%; text-align: center;">
      <asp:Label ID="lba" CssClass="aa" runat="server" Text="aaa" />
    </div>
like image 38
Xavier Avatar answered Oct 28 '25 13:10

Xavier