I've looked through many threads on how to do this but and applied the things on there but still struggling to do this, the text does get centered but the actual elements still stay on the left of the screen.
The form:
<div class="row">
<div class="col-md-6">
<div class="formdiv">
<form id="my-form" method="post">
<div asp-validation-summary="All" class="text-danger"></div>
<div class="form-group">
<label asp-for="OrderEmail"></label>
<br />
<input asp-for="OrderEmail" />
</div>
<button id="update-profile-button" type="submit" class="btn btn-primary">Send</button>
</form>
</div>
</div>
</div>
CSS:
.formdiv {
display: block;
text-align: center;
}
#my-form {
display: inline-block;
margin-left: auto;
margin-right: auto;
text-align: left;
}