FG
💻 Software

Resize a photo in HTML and keep aspect ratio

Fresh6 days ago
Mar 15, 202641803 views
Confidence Score0%
0%

Problem

I would like to display photos that I upload (to my drupal site) and I would like to make the photos smallers but using heigh=100 does not honour the aspect ratio. All i want to do is make the photo zoom smaller.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Resize a photo in HTML and keep aspect ratio

Low Risk

You can accomplish this with a stylesheet. First, define the following style: Then, add this style to your image tags, like so: Do not include the and elements this time. The first half of that style is for browsers that support the and properties -…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment