Image Responsive

Anyone knows how to make image become responsive in ionic?

1 Like

Width: 100% with CSS? :smiley:

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

1 Like

maybe works:

width: 100%;
height: auto;
6 Likes

@Whiff great thaks bro :slight_smile:

@vanbumi One more trick can be done,

max-width: 100%;
height: auto;

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

1 Like