html - How to change img width but keep original height in css? -
in css, how can change image width twice big, keep height same original height?
i tried
img { width : 400px; height : auto; } it should work ie11+. images being dynamically loaded, don't know original height, know width (its specified parameter).
but not work
twice big or 400px wide?
to make twice (or whatever x times bigger or smaller) use css3 scale transformation.
img { transform: scale(2); } this grow image in place in directions maybe want move bit:
img { transform: scale(2) translate(25%, 25%); } see css3 transform functions. pretty useful.
Comments
Post a Comment