Anyone knows how to make image become responsive in ionic?
1 Like
Width: 100% with CSS?
@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
@vanbumi One more trick can be done,
max-width: 100%;
height: auto;
not worked for me.
I used following code.
.img-responsive{
/*height: auto;
max-width: 100%;
*/
width: 100%;
height: auto;
}
But this work for me
.img-responsive{
background-image: url(’…/img/abc.png’);
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
}
1 Like