HTML HTML5基本模板(带评论)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HTML HTML5基本模板(带评论)相关的知识,希望对你有一定的参考价值。

<!DOCTYPE html>

<!-- 
     HTML5 is the latest evolution 
     of standards that defines HTML. 
-->

<!-- The best way to specify language in HTML5. -->

<html lang="en">

    <head>
    
        <!-- This is easier to type, and remember than http-equiv. -->
        
        <meta charset="utf-8">
        
        <!--
            If you want to add more METAs,
            just know not to go overboard
            with them. 
            
            They're not relied on a lot 
            nowadays. 
            
            I do suggest still using a 
            few of them though, like
            "charset."
        -->
        
        <!--
            Stylesheets prohibit progressive
            rendering until they're all
            downloaded.
            
            Keep them inside the HEAD to
            eliminate this problem.
            
            NEVER apply CSS in-line internally,
            always externally.
            
            Drop the 'type' attribute in HTML5
            for optimization.
        -->
        
        <link rel="stylesheet" href="style\">
        <link rel="icon" href="image\">
        
        <!-- Appears on the tab in the browser. -->
        
        <title></title>
        
        <!-- 
            As you may or may not have already
            realized, HTML5 isn't supported in
            older versions of internet explorer.
            
            To compensate for this, you should
            use html5shiv to add support to
            HTML5.
            
            The code used to do this, will only
            work inside the HEAD, however.
            
            And for performance sake, this should
            go after the CSS.
        -->
        
        <!--[if lt IE 9]>
            <script src="dist/html5shiv.js"></script>
        <![endif]-->
        
    </head>
    
<!--
    Use class instead of id
    whenever possible.
    
    Id have more "weight"
    than class when it comes
    to applying styles.
    
    This can prevent some CSS 
    classes applied on elements 
    inside the container from 
    working properly.
-->

<body><div class="container">

<!-- 
    Despite the addition of new
    elements that justifably
    captures a lot of DIV's territory,
    you can still use them.
    
    The best practice is to use
    DIVs when there is no other
    more semantically appropiate
    element that suits your
    purpoe.
-->

<header>

    <hgroup>
        <h1>Title</h1>
        <h2>Slogan</h2>
    </hgroup>
    
</header>

<!--
    In CSS, don't do:
    
        nav ul {
        
        }
    
    Instead, you should do:
    
        #navigation {
        
        }
        
    But you can still do:
    
        header {
        
        }
    
    if you need only one.
    
    Reduce those HTTP Request!
-->

<nav><ul class="navigation">

    <!--
        All text inside a HTML element
        should be lowercase to make it
        easier to read.
    -->
        
    <li class="active"><a href="home.html">Home</a></li>
    <li><a href="contact.html">Contact</a></li>
    <li><a href="about.html">About</a></li>
    
</ul></nav>

<div class="main">

    <!--
        Why would I use ARTICLE
        when it should be SECTION
        instead?
        
        From the specs, doing that
        isn't the true, intended
        purpose of that element.
    -->
    
    <article>
    
        <!--
            Utilize :first-child, :last-child and 
            :nth-child to get non-classed elements
            for CSS.
        -->
        
        <hgroup>
            <h1>Title</h1>
            <h3>Author</h3>
        </hgroup>
            
            <!--
                Don't do this:
                
                    <p>Message
                
                    <p>Message
                
                You should close those tags.
            -->
            
            <p>Message</p>
            <p>Message</p>
            <p>Message</p>
            
        <footer>Date</footer>
        
    </article>
    
</div>

<footer>Copyright</footer>

<!-- 
    Scripts prevents progressive rendering, parallel 
    downloads for all content below. 
    Move them to the bottom for faster page loading.
    
    JQuery is a fast, small, and feature-rich
    JavaScript library. "Write less, do more."
-->

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

<!--
    You'll need a fallback for when the website
    you're retrieving JQuery from, fails.
    
    There are other ways to do this than the
    one I'm coding here (protocol-less URLS).
-->

<script>window.jQuery || document.write('<script src="js/jquery-2.0.0.min.js">\x3C/script>')</script>

<!-- 
    Finally, always comment your code.
    You'll be suprised at how much
    faster you'll from it.
-->

</div></body>
</html>

html 带CDN的Bootstrap基本模板

<!DOCTYPE html>
<html>
  <head>
    <title>Bootstrap 3 Template</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
 
    <!-- Bootstrap core CSS -->
    <link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet" media="screen">
 
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="http://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.js"></script>
      <script src="http://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js"></script>
    <![endif]-->
  </head>
  <body>
    <h1>Hello, Bootstrappers!</h1>
 
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/js/bootstrap.min.js"></script>
  </body>
</html>

以上是关于HTML HTML5基本模板(带评论)的主要内容,如果未能解决你的问题,请参考以下文章

html 最好的Html5基本模板

html 基本的HTML5页面模板

HTML HTML5基本模板

HTML HTML5基本媒体模板

HTML HTML5基本页面模板

HTML HTML5基本模板