【问题标题】:Website previews fine on Mac Safari, Firefox, Chrome but only body shows on PC browsers网站在 Mac Safari、Firefox、Chrome 上预览良好,但仅在 PC 浏览器上显示正文
【发布时间】:2013-11-28 05:11:44
【问题描述】:

在测试期间,我遇到了网站在 PC 浏览器(包括 IE、Chrome 和 Firefox)中正常显示的问题。然而,它已经在 Mac 版本的 Safari、Firefox 和 Chrome 上进行了很好的测试。

特别是仅显示正文中的 x-repeat 背景图像。所有其他内容根本没有显示。

http://www.spmguardians.org/2013/index.html

奇怪的是,IE 10 可以正确预览以下页面,但不能正确预览上面的页面引用:

http://www.spmguardians.org/2013/calendar/index.html

任何帮助将不胜感激!

【问题讨论】:

  • 您缺少doctype。尝试在页面顶部添加<!DOCTYPE html>。您可能希望使用此工具来确保您的 HTML 有效并检查是否存在任何其他问题:validator.w3.org
  • 对我来说似乎工作得很好?
  • 谢谢。我添加了 现在它在 IE10 中可以正确预览,但在 IE9、IE8、IE7 中仍然显示为空白...
  • 检查这里的错误并尝试更正它们:validator.nu/…
  • 在 debian 6 chrome 19 上为我工作,但是当我将鼠标悬停在菜单上时,它会在菜单项上方闪烁片刻,然后才能正确渲染

标签: jquery html css internet-explorer google-chrome


【解决方案1】:

虽然页面加载正常(我使用的是 MacBook Pro 和 Safari),但我可以在您的代码中看到一些语法错误。

<meta name="viewport" content="width=device-width, user-scalable=yes"></meta>

您应该像这样关闭元标记:

<meta name="viewport" content="width=device-width, user-scalable=yes" />

另外,

在#explore DIV 下有几行...

    <div id="exploremenutop"> <a class="explore1" title="Guardian scores and schedules" a href="http://www.centralmassconference.org/g5-bin/client.cgi?G5genie=585">Guardian scores and schedules</a></div>
    <div id="exploremenutop"> <a class="explore2" title="Campus ministry, Grade 9 retreat" a href="PDFs/9th-Grade-Retreat-2017.pdf">Campus ministry, Grade 9 retreat</a></div>
    <div id="exploremenutop"> <a class="explore2" title="Parent Board News" a href="parentboard/index.html">Parent Board News</a></div>
    <div id="exploremenutop"> <a class="explore2" title="Alumni: Stay connected!" a href="alumninews/index.html">Alumni: Stay connected!</a></div>
    <div id="exploremenutop"> <a class="explore2" title="Student/Parent Handbook" a href="PDFs/Handbook2013-14.pdf">Student/Parent Handbook</a></div>
    <div id="exploremenutop"> <a class="explore2" title="College Contest for Juniors" a href="PDFs/CollegeVisitCompetition.pdf">College Contest for Juniors</a></div>

您指定a 两次...一次在标记的开头(它所属的位置),再次在href 之前。删除每一行中多余的a

另一个...这段代码:

      <!-- end #sidebar1 -->
  </span></div>

关闭span 似乎并没有关闭任何实际标签。我找不到与之匹配的开口跨度。

那些是我跳出来的错误......可能有更多的语法错误,但经历和修复这样的小错误应该有助于在更多浏览器中呈现。每个浏览器处理错误的方式不同 - 有些可以解决错误,有些会死掉,有些只是显示您的页面错误,等等。

【讨论】:

  • 谢谢@Charlie74。我做了建议的更正,但不幸的是页面仍然只能在 IE10 或 IE11 中正确呈现。
猜你喜欢
  • 1970-01-01
  • 2017-08-25
  • 1970-01-01
  • 2023-04-01
  • 1970-01-01
  • 1970-01-01
  • 2017-04-06
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多