diff --git a/css/amp.css b/css/amp.css index 0bb95057f6da..a41212a1f318 100644 --- a/css/amp.css +++ b/css/amp.css @@ -17,9 +17,16 @@ /** * Horizontal scrolling interferes with embedded scenarios and predominantly * the result of the non-responsive design. + * + * Notice that it's critical that `overflow-x: hidden` is only set on `html` + * and not `body`. Otherwise, adding `overflow-x: hidden` forces `overflow-y` + * to be computed to `auto` on both the `body` and `html` elements so they both + * potentially get a scrolling box. See #3108 for more details. */ -html, body { +html { overflow-x: hidden !important; +} +html, body { height: auto !important; } diff --git a/examples/everything.amp.html b/examples/everything.amp.html index 071998d5a62d..36f00b839172 100644 --- a/examples/everything.amp.html +++ b/examples/everything.amp.html @@ -92,6 +92,18 @@ #amp-iframe:target { border: 1px solid green; } + + #breaker { + height: 100px; + background: green; + } + + #breaking { + height: 200px; + width: 200vw; + background: rgba(0, 0, 0, 0.5); + } + @@ -362,6 +374,10 @@