Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

inline css background-size cover

Tags:

css

i'm having the following css code

.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;
}

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

am i using the inline css wrong ?

like image 763
Ivo Avatar asked Nov 28 '22 05:11

Ivo


1 Answers

Use this code, cleaner than @RAS version:

background: url(image.jpg) no-repeat center center / cover;
like image 145
Fred K Avatar answered Jan 03 '23 18:01

Fred K