Hey everyone, I need some help with a confusing issue.
I'm currently working on an AngularJs project and I am struggling to set a background image for a specific component without affecting the entire application. My goal is to have the image cover the full width of the browser window. However, I am facing an issue where there is a white space at the bottom of the component, which gets larger on bigger screens.
You can see in this image that the background image (1) cuts off where the container ends
The purple line serves as a border to indicate the container.
Component CSS
.align-text-message{
text-align: center;
}
.content-data{
margin-left: 3%;
margin-top: 2%;
}
.fondo_seccion{
background-image: url("../../assets/img/fondo_datos.png");
height: auto;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
margin-top: 0.75%;
}
.menu-dashboard{
opacity: 0.9;
margin-top: -2%;
}
.infoUser{
margin-top: 4%;
}
@media only screen and (max-width: 600px) {
.content-data{
margin-left: 0%;
margin-top: 15%;
z-index: -1;
position: absolute;
}
.menu-dashboard{
min-height: auto;
}
}
Component HTML
<div class="infoUser">
<div class="row">
<div class="col-md-10 menu-dashboard">
<app-dashboard></app-dashboard>
</div>
</div>
<div class="row fondo_seccion">
<div class="col-md-11 content-data">
<div class="form-group" [hidden]="!basicLevelFormComponent.userNoInfo">
<div class="alert alert-warning align-text-message" role="alert">
You haven't entered your information yet!
</div>
</div>
<div class="form-group" [hidden]="!basicLevelFormComponent.fatalError">
<div class="alert alert-danger align-text-message" role="alert">
We couldn't load your information!
</div>
</div>
<div class="form-group" [hidden]="!basicLevelFormComponent.infoSuccess">
<div class="alert alert-success align-text-message" role="alert">
Information updated successfully!
</div>
</div>
<div class="form-group" [hidden]="!basicLevelFormComponent.userNotify">
<div class="alert alert-warning align-text-message" role="alert">
{{basicLevelFormComponent.messageNotify}}
</div>
</div>
<app-basic-level-form [hidden]="!showBasicLevelForm"></app-basic-level-form>
<br/>
</div>
</div>
</div>
I've attempted moving the "fondo_seccion" class from its current position to where "infoUser" is located in the HTML but unfortunately, it did not solve the issue.