labelTest.text = @"This is my Teststring.This is my Teststring.This is my Teststring.This is my Teststring.This is my Teststring.This is my Teststring."; labelTest.numberOfLines = 0; [labelTest sizeToFit];
autosize
How to resize a image proportionally with CSS
To resize a image proportionally with CSS, simply set either width or height to auto. This should also work if the img html tag has width and height attributes set.
img.resize{ width:200px; height: auto; }
How to fit image size to div size in HTML
To fit image size to div size in HTML you need to set max-width and max-height without applying an explicit width or height.
Sample HTML
max-width:100%; max-height:100%;