繁体   English   中英

需要背景色来填充空间

[英]Need background-color to fill space

我的background-color属性未完全填满该空间(参见图片) 背景未填充 (图像在页面的右上和右上显示页面内容,但是背景颜色没有填充空白)

代码如下所示:

<body style="background-color: #163a4b; color: white">
    <app-navbar></app-navbar>
    <div style="margin: 15px">
        <router-outlet></router-outlet>
    </div>
</body>

 <body style="background-color: #163a4b; color: white"> <app-navbar></app-navbar> <div style="margin: 15px"> <router-outlet></router-outlet> </div> </body> 

所需的附加操作是在index.html上而不是组件的HTML上做背景色。 这样可以解决问题。

之前(app.component.html)

<body style="background-color: #163a4b; color: white">
    <app-navbar></app-navbar>
    <div style="margin: 15px">
        <router-outlet></router-outlet>
    </div>
</body>

之后(index.html)

<!doctype html>
<html lang="en">
<body style="background-color: #163a4b;">
  <app-root></app-root>
</body>
</html>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM