Image Responsive


#1

Anyone knows how to make image become responsive in ionic?


#2

Width: 100% with CSS? :smiley:


#3

@tobbe oke thanks how about the height? on portrait position is height will follow height device, but in landscape image will be short and ugly, any advice?


#4

maybe works:

width: 100%;
height: auto;

#5

@Whiff great thaks bro :slight_smile:


#6

@vanbumi One more trick can be done,

max-width: 100%;
height: auto;

#7

not worked for me. :frowning:
I used following code.

.img-responsive{
/*height: auto;
max-width: 100%;
*/
width: 100%;
height: auto;
}

But this work for me :smile:
.img-responsive{
background-image: url(’…/img/abc.png’);
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
}