为什么谷歌浏览器没有显示我的HTML代码?

时间:2016-06-21 17:49:21

标签: html css

我创建了一个文件" index.html"并在谷歌浏览器上打开它,但页面没有显示任何内容。我认为问题在于我的浏览器设置,因为该代码在系统更新之前有效。但是,我无法找到解决方案。这是我的代码。

<!DOCTYPE html>
    <html>
    <head>
      <meta charset="utf-8">
      <meta name="description" content="The page presents TOP 5 TV serials. Check them out!"/>
      <meta name="keywors" content="TOP 5, serials, the best, the most interesting, watch, share">
      <title>The best serials - TOP 5!</title>

      <style>
      #container
      {
        width: 1000px;
        margin-left: auto;
        margin-right: auto;
      }
      #logo
      {
        background-color: black;
        color: white;
        text-align: center;
      }
      #nav
      {
        float: left;
        background-color: lightgray;
        width: 140px;
        min-height: 620px;
        padding: 10px;
      }
      #content
      {
        float: left;
        width: 640px;
        padding: 20px;
      }
      #ad
      {
        float: left;
        background-color: lightgray;
        width: 140px;
        min-height: 620px;
        padding: 10px;
      }
      #footer
      {
        clear: both;
        background-color: black;
        color: white;
        text-align: center;
        padding: 20px;
      }
      </style>
    </head>

    <body>
      <div id="container">

        <div id="logo">
          <h1>The best serials - TOP 5!</h1>
        </div>

        <div id="nav">
          Dr House<br/>
          True Detective<br/>
          Breaking Bad<br/>
          Big Bang Theory<br/>
          The X Files<br/>
        </div>

        <div id="content">
          House (also called House, M.D.) is an American television medical drama that originally ran on the Fox network for eight seasons, from November 16, 2004 to May 21, 2012. The show's main character is Dr. Gregory House (Hugh Laurie), a pain medication-dependent, unconventional, misanthropic medical genius who leads a team of diagnosticians at the fictional Princeton–Plainsboro Teaching Hospital (PPTH) in New Jersey.

          <br/><br/>

          The show's premise originated with Paul Attanasio, while David Shore, who is credited as creator, was primarily responsible for the conception of the title character. The show's executive producers included Shore, Attanasio, Attanasio's business partner Katie Jacobs, and film director Bryan Singer. It was filmed largely in Century City.
        </div>

        <div id="ad">
          <img src="ad.jpg"/>
        </div>

        <div id="footer">
          The best serials - TOP 5! &copy; All rights reserved
        </div>
      </div>

    </body>
    </html>

2 个答案:

答案 0 :(得分:2)

您的title标记已损坏。

而不是<title>The best serials - TOP 5!</title="">您应该<title>The best serials - TOP 5!</title>

有关详情:http://devdocs.io/html/element/title

你的文档类型也被打破了。使用<!DOCTYPE HTML>代替<!DOCTYPE>

有关详情:https://developer.mozilla.org/en-US/docs/Glossary/Doctype

答案 1 :(得分:0)

最顶端必须是

<!DOCTYPE html>
  <html>

不是

<!DOCTYPE>
    <html>