I want to try to size a div width as an inverse of the screen size, until it hits a maximum of 100%, using only CSS (no JS please).
To be clear, here is an example:
- if the screen size is 500px wide the div width would be 100%
- if the screen size is 1000px wide the div would be 50%
- and so on
I don't want to use media queries because its just too much micromanaging, im hoping for some kind of proportional calc() way of doing this
So far I've been proportionally sizing div widths using 'vw' dimensions which works just fine, but in this case I want to try to do the inverse.
I'm hoping someone has come up with a piece of magic methodology to do this?