fluid layout - Scale image with CSS but limit to orignial size -


for responsive design, scale down images:

img {     width:100%;     height:auto; } 

this works expected, if width of screen exceeds original size of image, blows image.

is there way limit scaling original size? gets smaller if necessary?

thanks in advance answer.

willem

you use max-width prevent image width becoming larger original size.

img {     width: auto;     max-width: 100%;     height: auto; } 

Comments

Popular posts from this blog

javascript - IndexedDB error: Uncaught DataCloneError: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned -

amazon web services - When using Cognito credentials with AWS in a browser (javascript), keep getting "missing credentials" error -

c# - How to set the datatextfield value instead of the value on a drop down list? -