activeworker Posted April 23, 2013 Report Share Posted April 23, 2013 how i can resize images when display website in mobile ? or res is <700px when images have 200px; weight or res is <300px when images have 1500px; weight etc. Thank you. Quote Link to comment Share on other sites More sharing options...
newseed Posted April 23, 2013 Report Share Posted April 23, 2013 You need to use a little css for that. First, your image tag should be clean and free of any inline css styles. <img class="flexsize" alt="my image" src="/path-to/image.jpg"> The css is simple: .flexsize { width: 100%;} You can use height but not height and width together. Also, the class name is whatever you choose it to be. If you are planning on using a 1500px image then it's going to cause the mobile devices time to download it as well as more data usage. There are more complex ways to size images within any computer or devices. Some can be done where if viewing a site via a computer it will load this image and if a mobile device it will load a different image specifically for that device. Quote Link to comment Share on other sites More sharing options...
Johnclr Posted April 27, 2013 Report Share Posted April 27, 2013 try this one : <img src="smiley.gif" alt="Smiley face" height="42" width="42"> Quote Link to comment Share on other sites More sharing options...
Andrea Posted April 27, 2013 Report Share Posted April 27, 2013 try this one : <img src="smiley.gif" alt="Smiley face" height="42" width="42"> How is that supposed to address a mobile device or anything that's not a tiny, square picture? Quote Link to comment Share on other sites More sharing options...
grabenair Posted April 28, 2013 Report Share Posted April 28, 2013 You can do as above. But a better way is to have an image for the desktop and one in another size for mobile. Then use media queries to put in the image you want for each. This way your mobile site is not unnecessarily loading a large img making the site load slow. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.