我有一個Angular 2應用程序。在這個應用程序中,我有幾個組件。我想僅爲登錄組件添加背景圖片。我怎麼做?如何在Angular 2組件中添加背景圖片?
body{
background-image: url('https://s.zkcdn.net/Advertisers/d36ea4926dfa4978ab2556ba7688692c.png') ;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
height:100%;
}
我有這種樣式的登錄組件。但它不覆蓋整個窗口。它只覆蓋表單部分。
[所以] *不是*自由代碼編寫的服務。預計你會嘗試**自己編寫代碼**。在[做更多研究]之後(http://meta.stackoverflow.com/questions/261592),如果你有問題,你可以**發佈你已經嘗試過**的清單,說明什麼是不工作的**並提供** [mcve] **。我建議閱讀[問]一個好問題和[完美問題](http://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/)。另外,一定要參加[旅遊]。 – Igor