Should browsers not show mobile content outside of content boundaries?
To illustrate my problem, take a look at the following fiddle: http://jsfiddle.net/ECaD6/
Pretend I made this web page where the center (dark gray) area is the main content of the page. The background of this content area is intentionally different from the color of the container, which contains no content.
I have positioned the image absolutely so that it lies outside the intended content area. This works and looks good in a desktop browser.
However, when viewed in a mobile browser, the user can zoom out on the page so they can see this:
I would love it if the browser could only scale down to the width of the content container. Is it possible? I could obviously bet overflow-x:hidden
on div
, but then it would actually cut off the soccer ball completely.
It would be nice if the mobile browser could just zoom out:
I know that technically the image (in this case) is part of the "content" since it's in the content div. I am wondering if there are any layouts or css tricks that can be used to achieve what I am looking for.
source to share