カテゴリ: xhtml
記事投稿日: 2011年10月21日
記事更新日: 2013年4月18日
みどりが使っているXHTMLのテンプレートです。(2013.04.18更新)
Web標準を勧告する団体W3Cが提供している「Markup Validation Service」で
合格していますので、大きな間違いはないと思いますが、
使用する場合はもちろん自己責任でお願いします。
賛否両論あるかと思いますので、ご意見のある方はぜひ突っ込んで下さい。
半年おきくらいに大手のサイトのソースを見て、
テンプレートを見直すといい勉強になります。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>サイトタイトル</title>
<meta http-equiv="content-language" content="ja" />
<meta name="description" content="サイト説明文" />
<meta name="keywords" content="キーワード1,キーワード2,キーワード3" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="author" content="Web Atelier Midori" />
<meta name="copyright" content="Copyright Web Atelier Midori All rights reserved. No reproduction or republication without written permission." />
<link href="スタイルシートのURL" rel="stylesheet" type="text/css" media="all" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script src="JavaScriptのURL" type="text/javascript"></script>
<link rel="start" href="サイトのトップページのURL" title="{$SITE_NAME}" />
<link rel="next" href="サイトマップページURL" title="サイトマップ" />
<link rel="help" href="お問い合せページのURL" title="お問い合わせ" />
<link rel="shortcut icon" href="ファビコン画像へのパス" />
</head>
<body>
</body>
</html>
SEO抜きで、開発でさっと使いたい時は以下のコードを使います。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>サイトタイトル</title>
<meta http-equiv="content-language" content="ja" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link href="スタイルシートのURL" rel="stylesheet" type="text/css" media="all" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script src="JavaScriptのURL" type="text/javascript"></script>
</head>
<body>
</body>
</html>
また、jQueryの動作を確認したいのなら、CDNの一行を追加すれば環境がそろいます。
HTMLファイル1枚でOK。簡単ですね。
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
コメントを残す