【发布时间】:2020-08-10 08:43:24
【问题描述】:
好吧,伙计们,我在这里有点困惑。
我正在使用 AngularJs 并尝试为一个特定组件设置背景图像,而不是为整个应用程序设置背景图像。 并试图让它覆盖浏览器的全部范围。现在它在底部 (2) 留下一个空白区域,屏幕越大,这个空白区域越大。
As you can see in the image (the background image (1) gets cut where the container ends
紫线只是显示容器的边框。
组件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;
}
}
组件 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">
¡Aún no ha ingresado su información!
</div>
</div>
<div class="form-group" [hidden]="!basicLevelFormComponent.fatalError">
<div class="alert alert-danger align-text-message" role="alert">
¡No hemos podido cargar su información!
</div>
</div>
<div class="form-group" [hidden]="!basicLevelFormComponent.infoSuccess">
<div class="alert alert-success align-text-message" role="alert">
¡Información actualizada!
</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>
我尝试的其中一件事是将 fondo_seccion 从现在的位置交换到 infoUser 所在的 DIV,但没有任何变化。
【问题讨论】: