I am working on an Angular project and struggling to center my Bootstrap 3 Modal horizontally on the screen. Despite trying various solutions like using text-align: center
and align = "center"
, I have been unsuccessful. Can someone guide me on how to properly center it?
Below is a condensed version of my modal:
<div class="col-xs-10" style="padding-top: 50px;">
<div class="panel panel-default col-xs-8" style="padding-left: 0px; padding-right: 0px;">
<div class="panel-heading">
<h3 class="panel-title pull-left" style="width: 300px;">Add New Employee</h3>
</div>
<div class="panel-body">
<form class="form-horizontal" role="form" style="overflow-x:auto;">
<fieldset>
<div class="col-xs-6">
<div class="form-group">
<label class="col-xs-5" style="padding-left: 0px"> Employee ID </label>
<div class="col-xs-7">
<input class='form-control' type="text" id="empID" [(ngModel)]="newEmp.EmpID" name="empID" placeholder="Employee ID" />
</div>
</div>
</div>
</fieldset>
</form>
</div>
</div>
</div>
And this is where it's being invoked:
<div id="addNewEmployeeModal" class="modal fade" tabindex="-1" role="form" aria-labelledby="myNewEmployeeModal" aria-hidden="true">
<pto-add-new (updateEmpInfo)="onUpdateEmpInfo($event)" (updateSelectedEmployee)="onUpdateSelectedEmployee($event)"></pto-add-new>
</div>
I apologize if this question seems redundant, but I can't seem to get any of the suggested solutions to work. I'm not sure if I'm applying the attributes to the incorrect div
or if there's another issue with my implementation.