Max image width

SpaceshipSpaceship
Watch

simonj

Established Member
Impact
15
Hi, forgive this newbie question...how do you set the maximum width for an image on a webpage without affecting images that are smaller? For instance, I want to limit the size a picture can be if it's too big but I don't want to stretch or resize smaller pictures.

hope I'm making sense,
thanks,
Simon
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
If you make a css class for images you can do something like this:

max-width:174px;
max-height:174px
 
0
•••
thanks, what's the code for doing that?
 
0
•••
In <head> add the following:

Code:
<style type="text/css">
img{max-width:100px;max-height:100px}
</style>

Hope that works!
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer
Appraise.net

We're social

Spaceship
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back