0

<img> appears to have very special rules with how it is sized. It knows about aspect ratios and adheres to them as best it can.

Is there any css which will make a non image item adhere to an aspect ratio?

I've tried using padding to shape divs, but it doesn't work with min-width, max-width, min-height, or max-height.

I'm really just looking for a simple way to say: "act like an image of this size and width".

Seph Reed
  • 6,511
  • 8
  • 42
  • 89
  • 1
    Possible duplicate of [Maintain the aspect ratio of a div with CSS](https://stackoverflow.com/questions/1495407/maintain-the-aspect-ratio-of-a-div-with-css) – Rob Dec 13 '19 at 17:47
  • 1
    This does work. It's not exactly what I was looking for, but what I'm looking for would be the best answer to that thread. – Seph Reed Dec 13 '19 at 17:54
  • 1
    Does this answer your question? [Maintain the aspect ratio of a div with CSS](https://stackoverflow.com/questions/1495407/maintain-the-aspect-ratio-of-a-div-with-css) – Velocibadgery Dec 13 '19 at 18:13
  • It's workable, but no. I was kind of trying to figure out what the native sizing algorithm was and how to use that. But I asked my question wrong, and if there was a way this other question would have it as an answer. – Seph Reed Dec 13 '19 at 20:39

0 Answers0