Jump to content

Recommended Posts

Posted

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.

Posted

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?

Posted

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...