I have the following code in an HTML component.I have applied bootstrap for loading prebuilt components like buttons. Its aligning very weirdly, I'm not the strongest guy at HTML alignment more of a backend/infra guy. How do I go about learning how to groups divs together so that I can align them as needed?
My objective with this question is to center these elements on the screen in a way so that one is on top of the other.
Here's what it looks like-
How do I get heading for Component to be set right above the choose file element?
I need center align all these elements on top of one another.
.upload-form-component {
margin: 400px 500px;
/* I have added the !important attribute just for debugging, you can remove it. */
}
.upload-container {
align-items: center;
display: grid;
flex-direction: row;
}
.main-text-box {
font-size: 30px;
text-align: center;
}
.upload-button {
align-items: center;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
<main>
<div class="upload-container">
<div class="main-text-box">Heading for Component</div>
<div class="upload-form-component">
<input class="form-control" type="file" (change)="onChange($event)">
<button (click)="onUpload()" class="btn btn-success upload-button">
Upload
</button>
</div>
</div>
</main>