html页面模板

 提示:转载请注明原文链接

 本文永久链接:https://360us.net/article/37.html

这是一份写HTML的样板,每写一个新的HTML页面都可以用它来初始化。

<!--
HTML5. Use tags like <article>, <section>, etc.
See: http://www.sitepoint.com/web-foundations/doctypes/
-->
<!doctype html>

<html>
  <head>
    <meta charset="utf-8">

    <!--
    Ask IE to behave like a modern browser
    See: https://www.modern.ie/en-us/performance/how-to-use-x-ua-compatible
    -->
    <meta http-equiv="x-ua-compatible" content="ie=edge">

    <title>My Site</title>

    <!--
    Disables zooming on mobile devices.
    -->
    <meta name="viewport" content="width=device-width,initial-scale=1">

    <!--
    Stylesheet that minimizes browser differences.
    See: http://necolas.github.io/normalize.css/
    -->
    <link rel="stylesheet" href="css/normalize.css">

    <!--
    Our own stylesheet.
    -->
    <link rel="stylesheet" href="css/main.css">
  </head>
  <body>
    put content here
  </body>
</html>

在在这个简单的样板我们做了挺多事:

  • 指定使用 HTML5 语法

  • 要求 IE 遵守现代浏览器的渲染标准

  • 锁死页面在移动设备显示宽度

  • 引入了 normalize.css, 在默认的HTML元素样式上提供了跨浏览器的高度一致性


样板来自于思课(http://sike.io),非原创。

 评论
暂无评论