内联CSS背景尺寸封面 [英] inline css background-size cover

查看:80
本文介绍了内联CSS背景尺寸封面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下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;
}

那是正常工作,现在我需要用php更改img,所以我试图使用内联CSS

thats working as it should now i need to change the img with php so i'm trying to use inline 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>

现在只有背景尺寸的封面无法正常工作并且不会显示在萤火虫中

only now is the background-size cover not working and not showing up in firebug

我使用内联CSS错了吗?

am i using the inline css wrong ?

推荐答案

您需要使用单个style标签.

You need to use single style tag.

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

这篇关于内联CSS背景尺寸封面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆