Resizing an Image Proportionally with CSS
Query:
Can I resize an image to a percentage of its own size using only CSS?
Answer:
Yes, you can resize an image proportionally with CSS using the following methods:
Method 1: Visual Resizing
This method resizes the image visually, but not its actual dimensions in the DOM. The resized image will be centered within its original size.
img { transform: scale(0.5); }
The above is the detailed content of Can I Resize an Image Proportionally Using Only CSS?. For more information, please follow other related articles on the PHP Chinese website!