Image size depending on screen resolution?

Image size depending on screen resolution?

If you want to optimeze your website for mobile devices, you should use these css codes for all your major images like logos or banners.

1
2
 
width: 100%; max-width: 100px;

For an image, you should have:

1
2
 
<img src="files/img.jpg" style="width: 100%; max-width: 100px;">

100px is the maximum size of your image, you should measure it and put its default size.

Then go to http://quirktools.com/screenfly/ for example and test your website.

Add a comment: