大网数据广告活动
网站运营与故障问答

Google Mobile Usability says "Content wider than screen" even though I can't reproduce that locally and X overflow is set to hidden

· 52CE 我爱测

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 …

问题原文

原帖链接 · 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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2018-09-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。