After examining the form below, my goal is to center only the fields while keeping the navigation buttons in their original position. Specifically, I want only the tab-content
to be centered, excluding the tablist
s.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4f2d20203b3c3b3b3d2e3f0f7a617d617c">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">>
<section class="h-100">
<div class="rounded-lg d-block d-sm-flex">
<div class="profile-tab-nav border-right">
<div class="p-4">
<img class="rounded-circle" style="width: 100px" alt="Avatar"
src={{ request.user.profile.photo.url }}/>
</div>
<div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
<a class="nav-link active" id="profile-tab" data-toggle="pill" href="#profile-tab-panel" role="tab"
aria-controls="profile" aria-selected="true">
<i class="fa fa-universal-access text-center mr-1"></i>
Profile
</a>
<a class="nav-link" id="security-tab" data-toggle="pill" href="#security-tab-panel" role="tab"
aria-controls="security" aria-selected="false">
<i class="fa fa-shield text-center mr-1"></i>
Security
</a>
</div>
</div>
<div class="tab-content" id="v-pills-tabContent">
<form>
<div>
<label>
<input type="text" class="row" placeholder="First name">
</label>
</div>
<div>
<label>
<input type="text" class="row" placeholder="Last name">
</label>
</div>
<div>
<label>
<input type="email" placeholder="Email">
</label>
</div>
</form>
</div>
</div>
</section>
I attempted
<div class="tab-content" style="flex-direction: column" id="v-pills-tabContent">
and
<div class="tab-content" style="float: right" id="v-pills-tabContent">
and
<div class="tab-content" style="align-content: center; align-self: center; align-items: center" id="v-pills-tabContent">
and
<div class="tab-content justify-content-sm-center" id="v-pills-tabContent">
but despite trying suggestions from this SO question, the content remains aligned to the left with half the page empty. The only solution that seems effective involves hard coding a left margin, which is not ideal as it lacks flexibility across different screen sizes.