1

If you put width: 100%; onto an element, it will scale according to the container. Let's say this is the browser width. This works great and all.

At some point when you shrink the container, the element will stop shrinking due to the content being bigger than the browser width(container).

enter image description here

Is there a way to get this width where the container stops shrinking down?

The reason behind this is I want to let the container scale up and down until that point, and use css scale to make it fit smaller devices. So, something like this:Resize scale

Currently I manually find the breaking width and hard code it. This doesn't really work as the content changes this width.

Thanks in advance!

Vija02
  • 308
  • 3
  • 7
  • 1
    No, there isn't. But you can set a `min-width` yourself and then use CSS Media Queries to handle what to do at that width. – Scott Marcus Feb 23 '19 at 19:12
  • You could check if the element is overflowing on document resize. This is how you could check for overflow: https://stackoverflow.com/a/9541579/4855465. You could then add a class to the element to handle the styling – Gert-Jan Kooijmans Feb 23 '19 at 21:21

0 Answers0