You specified "form-control" CSS class for asp:Label control, which would apply "text-align: left;" to it. You said "want proper left & right aligned", can you clarify more about it or show example displaying
effect that you want, so that we can understand and help achieve it better.
Besides, if you'd like to make left align and right align text on the same line, you can refer to this SO thread that discussed similar issue.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
140 Points
515 Posts
Not displaying properly
Sep 26, 2019 11:27 AM|jsshivalik|LINK
Hi
I have below code & it is not properly aligned & i want to style Labels. Also want proper left & right aligned
Thanks
All-Star
40565 Points
6233 Posts
Microsoft
Re: Not displaying properly
Sep 27, 2019 02:51 AM|Fei Han - MSFT|LINK
Hi jsshivalik,
You specified "form-control" CSS class for asp:Label control, which would apply "
text-align: left;
" to it. You said "want proper left & right aligned", can you clarify more about it or show example displaying effect that you want, so that we can understand and help achieve it better.Besides, if you'd like to make left align and right align text on the same line, you can refer to this SO thread that discussed similar issue.
https://stackoverflow.com/questions/12438339/how-may-i-align-text-to-the-left-and-text-to-the-right-in-the-same-line
With Regards,
Fei Han
Member
140 Points
515 Posts
Re: Not displaying properly
Sep 27, 2019 03:08 AM|jsshivalik|LINK
Hi Fei
when u run above code Multiline Textbox & labels on left are not in proper alignment
Thanks
All-Star
40565 Points
6233 Posts
Microsoft
Re: Not displaying properly
Oct 07, 2019 08:20 AM|Fei Han - MSFT|LINK
Hi jsshivalik,
You can apply left and right padding to parent <div> of Multiline Textbox, like below.
With Regards,
Fei Han
Member
115 Points
99 Posts
Re: Not displaying properly
Feb 18, 2020 04:41 AM|shaili shah|LINK
As per your require, I have given the below code for label :
<asp:Label ID="lblLocation" runat="server" Text="Location" Style="background-color:aqua;color:white;" CssClass="form-control"></asp:Label>
Now I have written code for multiline textbox :
<div class="form-group">
<div class="row">
<div class="col-sm-4">
<asp:TextBox CssClass="form-control" ID="txtApprovalRemarks" TextMode="MultiLine" Rows="4" runat="server"></asp:TextBox>
</div>
</div>
</div>
I hope it will help you.
https://www.ifourtechnolab.com/asp-dot-net-enterprise-content-management