鍍金池/ 問答/HTML5  HTML/ 關(guān)于background-repeat 生效問題

關(guān)于background-repeat 生效問題

使用background引入背景圖。第一次單獨寫background-repeat: no-repeat;沒有生效。改成寫在地址后面就生效了,為什么呢?

第一次寫法如下,no-repeat沒有生效:

banner {

background-image: url(../images/book1.jpg);
backgroud-repeat: no-repeat;
backgroud-size: cover;
width: 100%;

}
效果

圖片描述

第二次寫在地址后面生效:

banner {

background-image: url(../images/book1.jpg) no-repeat;
backgroud-size: cover;
width: 100%;

}

clipboard.png

回答
編輯回答
挽青絲

backgroud-repeat: no-repeat;backgroud寫錯了,少一個n

2017年10月17日 23:11