在我的 Angular 应用下是一个奇怪的空间。 Space 是 body 标签的一部分,但它不是 app-root 标签的一部分。我怎样才能删除这个空间?
/*styles.css*/
@import './styles/themes.scss';
@include mat-core();
@include angular-material-theme($material-light-theme);
.dark-theme{
@include angular-material-color($material-dark-theme);
}
html, body { height: 100%; }
body { margin: 0; font-family: Verdana, Roboto, "Helvetica Neue", sans-serif; }
我已经在我的 App-Component 上试过了,但没有效果。
app-component.css
:host {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
}
/*app-component.scss*/
bg-intranet-header {
z-index: 2;
position: sticky;
top: 0;
}
最佳答案
在 styles.css(或 styles.scss,..)中,你放置:
body {
margin: 0;
}
这必须在那个特定的文件中。 如果它不起作用,请尝试:
body {
margin: 0 !important;
}
关于html - 如何删除 Angular 应用程序主体末端之间的奇怪空间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64314860/