we would like to center an html component.
The situation now:
.card{
width: 400px;
border: 3px solid #54722b;
left: 0;
right: 0;
margin: auto;
margin-top: 20px;
}
.card-header{
background-color: rgb(221, 211, 123);
}
.card-header h3{
color: white;
}
<div class="card">
<div class="card-header">
<h3>Title</h3>
</div>
<div class="card-body">
<div class="form-group">
<form (ngSubmit)="register()">
<div class="input-group form-group">
<input name="name1" class="form-control">
</div>
<div class="input-group form-group">
<input name="name2" class="form-control">
</div>
<div class="input-group form-group">
<input name="name3" class="form-control">
</div>
<div class="input-group form-group">
<input name="name4" class="form-control">
</div>
<div class="input-group form-group">
<input name="name5" class="form-control">
</div>
<div class="input-group form-group">
<input name="name6" class="form-control">
</div>
</form>
</div>
</div>
</div>
We tried: (but it didn't work)
To add to the .card
in the css file, the line:
position: fixed;
This line of code centered the component, but when we zoomed in, it was not possible to scroll the screen and see the entire component.
How to center the html component, so that after zooming in, it will be possible to scroll the screen?