リセットcss最新版 テンプレ

制作していてあった方が良いと思った物は、随時追加しております。

html5リセットcss

▼参考URL
http://www.html5.jp/html5doctor/html-5-reset-stylesheet.html

  • フォントサイズは指定しやすいように62.5%(10px)にしてあります。

@charset "UTF-8";

/*=================================================*/
/*  リセット                                       */
/*=================================================*/

html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, dialog, figure, footer, header,
hgroup, menu, nav, section,
time, mark, audio, video {
	margin:0;
	padding:0;
	border:0;
	outline:0;
	vertical-align:baseline;
	background:transparent;
}

article, aside, dialog, figure, footer, header,
hgroup, 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;
	border:0;
	vertical-align:baseline;
	background:transparent;
	text-decoration: none;
	cursor: pointer;
}

ins {
	background-color:#ff9;
	color:#000;
	text-decoration:none;
}

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 #000;
	cursor:help;
}

table {
	border-collapse:collapse;
	border-spacing:0;
}

hr {
    display:block;
    height:1px;
    border:0;
    border-top:1px solid #cccccc;
    margin:1em 0;
    padding:0;
}

input, select {
	vertical-align:middle;
}


/* Fonts
------------------------------------------------------------*/
html {font-size: 62.5%; /*10px*/
}
body {
font-family: /*"ヒラギノ角ゴ Pro W3","Hiragino Kaku Gothic Pro",*/"メイリオ",Meiryo,Osaka,"MS Pゴシック","MS PGothic",Sans-Serif;
line-height:1;
-webkit-text-size-adjust: 100%;
}

h1,h2,h3,h4,h5,h6 {
font-size: 100%;
font-weight: normal;
}

/*画像の隙間回避*/
img {
vertical-align: bottom;
}

*bodyに「-webkit-text-size-adjust: 100%;」追加しました。
↓こちらご参考ください。

iPhoneSafariでフォントサイズがおかしくなる問題
http://d.hatena.ne.jp/soratomo0714/20151026

*imgに「vertical-align: bottom;」追加しました。

xhtml1.0 リセットcss

xhtml1.0はこちらを使っております。

@charset "utf-8";

/*=================================================*/
/*  リセット                                       */
/*=================================================*/

html,body,div,h1,h2,h3,h4,h5,h6,p,blockquote,pre,address,ul,ol,li,dl,dt,dd,table,th,td,form,fieldset,input,textarea {
margin: 0;
padding: 0;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

ul,ol {
  list-style-type: none; /* リストマーカーを消す */
}

a {
  text-decoration: none; /* リンク下線を消す */
}
img,fieldset { border: 0; }
img, input {
  vertical-align: bottom;
}
hr,legend { display: none; }


/* Fonts
------------------------------------------------------------*/
html {font-size: 62.5%; /*10px*/
}

body {
	font-family: /*"ヒラギノ角ゴ Pro W3","Hiragino Kaku Gothic Pro",*/"メイリオ",Meiryo,Osaka,"MS Pゴシック","MS PGothic",Sans-Serif;
-webkit-text-size-adjust: 100%;
}

h1,h2,h3,h4,h5,h6 {
	font-size: 100%;
	font-weight: normal;
}

address,em { font-style: normal; }
strong,th { font-weight: normal; }
th { text-align: left; }


/* センター表示
------------------------------------------------------------*/
body {
  text-align: center;/*IE6でブラウザの中央表示*/
}
#wrapper {
  margin: 0 auto;/*ブラウザの中央表示*/
  text-align: left;
}

*bodyに「-webkit-text-size-adjust: 100%;」追加しました。

clearfix テンプレ(フロート解除できない時使用)

  • clear:bothする物がなくoverflow:hiddenも出来ない時使用。

cssに記載してhtmlファイルにはフロートした物の親ボックスにクラス名『clearfix』をつける(class="clearfix")

.clearfix:after {
  content: ".";  /* 新しい要素を作る */
  display: block;  /* ブロックレベル要素に */
  clear: both;
  height: 0;
  visibility: hidden;
  font-size:0.1em;
  overflow:hidden;
  line-height:0;
}

.clearfix { /zoom: 1;}

*「font-size:0.1em;」「overflow:hidden;」「line-height:0;」追加しました。



【関連記事】
iPhone用基本フォーマット
http://d.hatena.ne.jp/soratomo0714/20120815