csshtmlimageresize

Resizing images html/css


I have a couple of images in a facebook app. The problem is that the image is quite big and I need it to look well whether it is accessed from a computer or phone. Setting it to some fixed dimension would obviously make it look bad, considering the different screen dimensions.
So, how should I resize it so that it would look well on any screen?


Solution

  • Set the width and height on the img tags to be percentages (of their container):

    <img src="http://..." alt="" width="50%" height="30%" />
    

    Adjust percentages to your needs.