【便利!】HTML5の初期テンプレートのダウンロード

html5を作る上で静的なテンプレートがあると便利ですね。

こちらでは最低限のテンプレートの解説、ダウンロードをしていただくことが可能です。
また、HTMLの静的テンプレートから、phpを使った最低限include(共通化)されたテンプレートの2種類を準備しましたのでよろしければご利用ください。

静的テンプレート構成

静的テンプレートのダウンロードファイルには以下が含まれています。

index.html
/css/reset.css
/css/style.css
/js/
/img/

静的テンプレートのソースコード

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<title>ここにタイトルを入れてね!</title>
<meta name="description" content="ここはページの説明を120文字程度でいれます。">
<meta name="author" content="カンマ,区切り">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="/css/reset.css"/>
<link rel="stylesheet" type="text/css" href="/css/style.css"/>
<!--[if lt IE 9]>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.7.2.min.js'></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<link rel="shortcut icon" href="">
</head>
<body>
<header>
<h1>ディレクター.comの静的テンプレート!</h1>
<nav>
<ul>
<li><a href="/">メニュー1</a></li>
<li><a href="/">メニュー1</a></li>
</ul>
</nav>
</header>
<div class="wrap">
<div class="main">
<div class="main_inner">
<p>コンテンツはここですな</p>
</div>
</div>
</div>
<footer>
<p><small>©andnap.com</small></p>
</footer>
</body>
</html>

reset.cssのソースコード

reset.cssとは各ブラウザ間で生じるデフォルトのCSSの適応範囲を統一するものとなります。
firefoxではデフォルトは〇pxに設定されているのにchromeだ●pxに設定されているなど、
少なからずブラウザ間で差異は生じます。
複数のブラウザで正しく見れるようにするのも大切なことですので、ぜひ適応させてください。

body {
line-height:1;
}
article,aside,details,figcaption,figure,
footer,header,hgroup,menu,nav,section {
display:block;
}
nav ul {
list-style:none;
}
blockquote, q {
quotes:none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content:'';
content:none;
}
a {
margin:0;
padding:0;
font-size:100%;
vertical-align:baseline;
background:transparent;
}
/* change colours to suit your needs */
ins {
background-color:#ff9;
color:#000;
text-decoration:none;
}
/* change colours to suit your needs */
mark {
background-color:#ff9;
color:#000;
font-style:italic;
font-weight:bold;
}
del {
text-decoration: line-through;
}
abbr[title], dfn[title] {
border-bottom:1px dotted;
cursor:help;
}
table {
border-collapse:collapse;
border-spacing:0;
}
/* change border colour to suit your needs */
hr {
display:block;
height:1px;
border:0;
border-top:1px solid #cccccc;
margin:1em 0;
padding:0;
}
input, select {
vertical-align:middle;
}

静的テンプレート構成

表示は共通化しただけですので静的のと同じです。
CSSは省きます。

動的テンプレートのソースコード

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<title>ここにタイトルを入れてね!</title>
<meta name="description" content="ここはページの説明を120文字程度でいれます。">
<meta name="author" content="カンマ,区切り">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="/css/reset.css"/>
<link rel="stylesheet" type="text/css" href="/css/style.css"/>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.7.2.min.js'></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<link rel="shortcut icon" href="">
</head>
<body>
<header>
<h1>動的テンプレート!</h1>
<?php include './inc/header_nav.php' ?>
</header>
<div class="wrap">
<div class="main">
<div class="main_inner">
<p>コンテンツはここですな</p>
</div>
</div>
</div>
<footer>
<?php include './inc/footer.php' ?>
</footer>
</body>
</html>

静的な部分との違いは
以下でまとめているかどうかの違いだけです。

<?php include './inc/header_nav.php' ?>
<?php include './inc/footer.php' ?>