我有以下css代码 .imgf{ background: url(/thatscooking/FotoTC/FotoTC/ALWIN01.JPG) no-repeat center center ; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;} 这应该工作
.imgf{ background: url(/thatscooking/FotoTC/FotoTC/ALWIN01.JPG) no-repeat center center ; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; }
这应该工作,因为它现在我需要用PHP更改img所以我正在尝试使用内联css
<div style="background: url(/thatscooking/FotoTC/FotoTC/ALWIN01.JPG) no-repeat center center" style="background-size: cover" style="-webkit-background-size: cover" style="-moz-background-size: cover" style="-o-background-size: cover" class="imgf "> <div id="naamb"><p>Album Naam</p></div></div>
只是现在是背景大小的封面不起作用而且没有出现在萤火虫中
我使用内联css错了吗?
您需要使用单一样式标记.<div style="background: url(/thatscooking/FotoTC/FotoTC/ALWIN01.JPG) no-repeat center center; background-size: cover; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover;" class="imgf "> <div id="naamb"><p>Album Naam</p></div></div>