ホームページ ウェブフロントエンド H5 チュートリアル HTML5基本テンプレートのコード共有例

HTML5基本テンプレートのコード共有例

Mar 28, 2017 pm 04:02 PM

HTML5基本テンプレートのサンプルコード共有

<!doctype html><!-- simplified doctype works for all previous versions of HTML as well -->

<!-- Paul Irish&#39;s technique for targeting IE, modified to only target IE6, applied to the html element instead of body -->
<!--[if lt IE 7 ]><html class="no-js ie6"><![endif]-->
<!--[if (gt IE 6)|!(IE)]><!--><html><!--<![endif]-->

<head>
    <!-- simplified character encoding -->
    <meta charset="utf-8">

    <title>Easy HTML5 Template</title>
    <meta name="description" content="Easy HTML5 Template">
    <meta name="author" content="">

    <!-- Delete these two icon references once you&#39;ve placed them in the root directory with these file names -->
    <!-- favicon 16x16 -->
    <link rel="shortcut icon" href="/favicon.ico">
    <!-- apple touch icon 57x57 -->
    <link rel="apple-touch-icon" href="/apple-touch-icon.png">

    <!-- Main style sheet. Change version number in query string to force styles refresh -->
    <!-- link element no longer needs type attribute -->
    <link rel="stylesheet" href="css/screen.css?v=1.0">

    <!-- Modernizr for feature detection of CSS3 and HTML5; must be placed in the "head" -->
    <!-- Script tag no longer needs type attribute -->
    <script src="js/modernizr-1.6.min.js"></script>

    <!-- Remove the script reference below if you&#39;re using Modernizr -->
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

</head>

<!-- If possible, use the body as the container -->
<!-- The "home" class is an example of a dynamic class created on the server for page-specific targeting -->
<body>

    <!-- ******************************************************************** -->
    <!-- The content below is for demonstration of some common HTML5 elements  -->
    <!-- More than likely you&#39;ll rip out everything except header/section/footer and start fresh -->

    <!-- First header has an ID so you can give it individual styles, and target stuff inside it -->
    <header id="hd1">

        <!-- "hgroup" is used to make two headings into one, to prevent a new document node from forming -->
        <hgroup>
        <h1>Easy HTML5 Template</h1>
        <h2>tagline</h2>
        </hgroup>

        <!-- Main nav, styled by targeting "#hd1 nav"; you can have more than one nav element per page -->
        <nav>
            <ul>
                <li><a href="#">Home</a></li>
                <li><a href="#">About</a></li>
                <li><a href="#">Services</a></li>
                <li><a href="#">Contact</a></li>
            </ul>
        </nav>

    </header><!-- #hd1 -->

    <section id="main">

        <!-- Each section should begin with a new h1 (not h2), and optionally a header -->
        <!-- You can have more than one header/footer pair on a page -->
        <header>
        <h1>This is a Page Sub Title</h1>
        </header>

        <p>Some content...</p>

        <!-- The h2 below is a sub heading relative to the h1 in this section, not for the whole document -->
        <h2>Demonstrating EM and STRONG</h2>

        <!-- "strong" is used for SEO and contextual hierarchy -->
        <p><strong>This text will have more importance (SEO-wise and contextually)</strong></p>

        <!-- "b" is used for stylistic offset of text that&#39;s NOT important contextually -->
        <p><b>This text has visual importance but has no contextual or SEO importance</b></p>

        <!-- "em" is used for colloquial-style emphasis -->
        <p>This is a <em>very</em> collooqial expression.</p>

        <!-- There can be multiple footers on each page -->
        <!-- Secondary headers and footers don&#39;t necesarily need ids; they can be targeted via context (i.e. "#main footer") -->
        <footer>
        <!-- incite a riot: http://24ways.org/2009/incite-a-riot -->
        <p>Author: <cite>Louis Lazaris</cite></p>
        </footer>

    </section><!-- #main -->

    <!-- The "aside" element could be a sidebar (outside an article or section) -->
    <!-- Or it could reference other tangentially-related content within an article or section -->
    <aside id="sidebar">
    <p>Sidebar content</p>
    </aside>

    <!-- The main footer has an ID for targeting, similar to the main header -->
    <footer id="f1">
    <p>copyright © year</p>
    </footer><!-- #f1 -->

<!-- Remote jQuery with local fallback; taken from HTML5 Boilerplate http://html5boilerplate.com -->
<!-- jQuery version might not be the latest; check jquery.com -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape(&#39;%3Cscript src="js/jquery-1.4.4.min.js"%3E%3C/script%3E&#39;))</script>

<!-- Below is your script file, which has a basic JavaScript design pattern that you can optionally use -->
<!-- Keep this and plugin scripts at the bottom for faster page load; combining and minifying scripts is recommended -->
<script src="js/general.js"></script>

<!-- asynchronous analytics code by Mathias Bynens; change UA-XXXXX-X to your own code; http://mathiasbynens.be/notes/async-analytics-snippet -->
<!-- this can also be placed in the <head> if you want page views to be tracked quicker -->
<script>
var _gaq = [[&#39;_setAccount&#39;, &#39;UA-XXXXX-X&#39;], [&#39;_trackPageview&#39;]];
(function(d, t) {
    var g = d.createElement(t),
        s = d.getElementsByTagName(t)[0];
    g.async = true;
    g.src = (&#39;https:&#39; == location.protocol ? &#39;https://ssl&#39; : &#39;http://www&#39;) + &#39;.google-analytics.com/ga.js&#39;;
    s.parentNode.insertBefore(g, s);
})(document, &#39;script&#39;);
</script>
</body>
</html>
ログイン後にコピー

以上がHTML5基本テンプレートのコード共有例の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

Video Face Swap

Video Face Swap

完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

ホットツール

メモ帳++7.3.1

メモ帳++7.3.1

使いやすく無料のコードエディター

SublimeText3 中国語版

SublimeText3 中国語版

中国語版、とても使いやすい

ゼンドスタジオ 13.0.1

ゼンドスタジオ 13.0.1

強力な PHP 統合開発環境

ドリームウィーバー CS6

ドリームウィーバー CS6

ビジュアル Web 開発ツール

SublimeText3 Mac版

SublimeText3 Mac版

神レベルのコード編集ソフト(SublimeText3)

HTMLの表の境界線 HTMLの表の境界線 Sep 04, 2024 pm 04:49 PM

HTML の表の境界線に関するガイド。ここでは、HTML でのテーブルの境界線の例を示しながら、テーブル境界線を定義する複数の方法について説明します。

HTML のネストされたテーブル HTML のネストされたテーブル Sep 04, 2024 pm 04:49 PM

これは、HTML でのネストされたテーブルのガイドです。ここでは、テーブル内にテーブルを作成する方法をそれぞれの例とともに説明します。

HTML 左マージン HTML 左マージン Sep 04, 2024 pm 04:48 PM

HTML マージン左のガイド。ここでは、HTML margin-left の概要とその例、およびそのコード実装について説明します。

HTML テーブルのレイアウト HTML テーブルのレイアウト Sep 04, 2024 pm 04:54 PM

HTML テーブル レイアウトのガイド。ここでは、HTML テーブル レイアウトの値と例および出力について詳しく説明します。

HTML入力プレースホルダー HTML入力プレースホルダー Sep 04, 2024 pm 04:54 PM

HTML 入力プレースホルダーのガイド。ここでは、コードと出力とともに HTML 入力プレースホルダーの例について説明します。

HTML 内のテキストの移動 HTML 内のテキストの移動 Sep 04, 2024 pm 04:45 PM

HTML でのテキストの移動に関するガイド。ここでは、概要、マーキー タグが構文でどのように機能するか、および実装例について説明します。

HTML 順序付きリスト HTML 順序付きリスト Sep 04, 2024 pm 04:43 PM

HTML 順序付きリストのガイド。ここでは、HTML 順序付きリストと型の導入とその例についても説明します。

HTML の onclick ボタン HTML の onclick ボタン Sep 04, 2024 pm 04:49 PM

HTML オンクリック ボタンのガイド。ここでは、それらの紹介、動作、例、およびさまざまなイベントでの onclick イベントについてそれぞれ説明します。

See all articles