css样式重置
方法一:不推荐使用,这么写会让网页解析速度变慢。
*{
margin: 0;
padding: 0;
}
方法二:大家常用的写法,比较流行。
body, html, div, blockquote, img, label, p, h1, h2, h3, h4, h5, h6, pre, ul, ol,
li, dl, dt, dd, form, a, fieldset, input, th, td
{margin: 0; padding: 0; border: 0; outline: none;}
body{line-height: 1;font-size: 88% /* Decide for yourself if you want to include this. */;}
h1, h2, h3, h4, h5, h6{font-size: 100%;padding: .6em 0;margin: 0 15px;}
ul, ol{list-style: none;}
a{color: black;text-decoration: none;}
a:hover
{text-decoration: underline;}
.floatLeft{float: left;padding: .5em .5em .5em 0;}
.floatRight{float: right;padding: .5em 0 .5em .5em;}
方法三:推荐第三种方法,使浏览器显示的元素保持一致,只针对需要统一样式的元素。
normalize.css
<link rel="stylesheet" type="text/css" href="http://www.yyyweb.com/demo/inner-show/normalize.html">