问题原文
原帖链接 · LeonidMew · CC BY-SA 4.0
Unable to fix error Google Mobile Usability > Content wider than screen in Google Search Console. I have try chrome mobile layout emulator from DevTools, set width to 320px but no horizontal scroll appears. So, all looks fine in emulator but google raises error. Then, I have add to css:
@media screen {
html, body {
width: 100%;
overflow-x: hidden;
}...
But no effect, error still persist.
Test Live URL tool don't show any error, all pages mobile friendly.
Any idea how to fix this? I'm sure this is google bug, but how to avoid it?
已采纳解答
原帖链接 · LeonidMew · CC BY-SA 4.0
I have remove all "position: absolute" from classes. But that classes were assigned to hidden content what fit fine on smallest smartphone screen, also most of them were not connected to any page element, because elements were password protected.
I found a way to quicker render pages, not waiting long time after clicking "request indexing". First create new page, using site template and css, text on page should be unique(Lorem Ipsum Generator help with that). Second, create one more sitemap file with only one url pointing to new file, sibmit it and in a 5 minutes you'l have crawled and indexed page. That helps a lot while searching a bug in template or css.
Edit: So the bug in position: absolute; even with width: 220px; it makes Google Search Console find error in page. Solution is to remove position: absolute and set it with javascipt again. In my case that was popup dialogues, and javascript was heeded to raise dialogues anyway. That javascript need to take in account window size.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
