I am trying to align a card div element to the left side of my web form as by default it is sitting slightly off centre.
I have tried various methods to get this to work however I have only been able to centre it successfully and not get it to dock at the left side of the page.
Can anyone assist?
<divclass="card text-white bg-primary mb-3"style="max-width: 70rem; float: left;"><divclass="card-header"><h4>Add User</h4></div><divclass="card-body"><divclass="row"><divclass="col-md-5"><asp:Labelid="lblUsername"Text="Username"runat="server"/></div><divclass="col-md-5"><asp:Labelid="lblFirstName"Text="First Name"runat="server"/></div></div><divclass="row"><divclass="col-md-5"><asp:TextBoxid="tbUsername"class="form-control"placeholder=""runat="server"ValidationGroup="AddUserVG"/><asp:RequiredFieldValidatorid="rfvUsername"class="text-danger"runat="server"ControlToValidate="tbUsername"ValidationGroup="AddUserVG"ErrorMessage="Please enter username"Display="Dynamic"></asp:RequiredFieldValidator></div><divclass="col-md-5"><asp:TextBoxid="tbFirstName"class="form-control"placeholder=""runat="server"ValidationGroup="AddUserVG"/><asp:RequiredFieldValidatorid="rfvFirstName"class="text-danger"runat="server"ControlToValidate="tbFirstName"ValidationGroup="AddUserVG"ErrorMessage="Please enter first name"Display="Dynamic"></asp:RequiredFieldValidator></div></div><asp:ButtonID="btnSave"Text="Save"CssClass="btn btn-primary"style="float: right"OnClick="btnSave_OnClick"runat="server"ValidationGroup="AddUserVG"/></div></div>
According to your description and codes, I couldn't reproduce your issue. You only post the card.
Please post codes about out of the card in the page.
Best regards,
Yijing Sun
ASP.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. Learn more >
According to your code, it aligns a card div element to the left side of your web form.
There is no issue in this code you posted for the card but there is an issue above the card.
Please post codes about out of the card on the page.
Blockchain software companies india
http://www.ifourtechnolab.com/blockchain-technology
None
0 Points
1 Post
How to left align a card div
Mar 04, 2021 09:00 AM|MattNorman|LINK
I am trying to align a card div element to the left side of my web form as by default it is sitting slightly off centre.
I have tried various methods to get this to work however I have only been able to centre it successfully and not get it to dock at the left side of the page.
Can anyone assist?
Contributor
4040 Points
1568 Posts
Re: How to left align a card div
Mar 05, 2021 02:23 AM|yij sun|LINK
Hi MattNorman,
According to your description and codes, I couldn't reproduce your issue. You only post the card.
Please post codes about out of the card in the page.
Best regards,
Yijing Sun
Member
70 Points
80 Posts
Re: How to left align a card div
Mar 10, 2021 04:39 AM|ifour.parth@gmail.com|LINK
According to your code, it aligns a card div element to the left side of your web form.
There is no issue in this code you posted for the card but there is an issue above the card.
Please post codes about out of the card on the page.
http://www.ifourtechnolab.com/blockchain-technology