Why does <amp-sidebar>
HAVE to be the direct child of the body?
I am in a situation where, in terms of code structure, it would be much easier for me to include <amp-sidebar>
within a <div>
. I want it to behave exactly like <amp-sidebar>
, but I simply don't have any easy way to place an element as the direct child of a <body>
.
I was especially confused when I saw that this amp-by-example page does not pass the AMP validator.
Could someone please illuminate me? I thought about opening an issue on github, but I'm not sure if there's a bug.
According to a lead dev of the AMP project, the requirement that <amp-sidebar>
is child of <body>
is due to a Safari bug with position:fixed
. Link to tweet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With