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 so
Solution 1:
Set the width and height on the img
tags to be percentages (of their container):
<imgsrc="http://..."alt=""width="50%"height="30%" />
Adjust percentages to your needs.
Solution 2:
Try this
img
{
width:100%;/*adjust this value to your needs*/max-width: the size of the image;/* so it wont get bigger and pixelated*/height:auto;
}
another option if possible, is to use media queries, so for different browser sizes, you can load different size of the image.
here is a fiddle to see if this is what you are trying to achieve
Post a Comment for "Resizing Images Html/css"