簡體   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