码迷,mamicode.com
首页 > Web开发 > 详细

reset css

时间:2014-07-13 10:09:47      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   问题   for   

reset css,即CSS重置,就是由于各种浏览器解释CSS样式的初始值有所不同,导致工程师在没有定义某个CSS属性时,不同的浏览器会按照自己的默认值来为没有定义的样式赋值,所以我们要先定义好一些CSS样式,来让所有浏览器都按照同样的规则解释CSS,这样就能避免发生这种问题。

网上reset css的代码很多,我也根据自己平时的项目需求整理了一份reset.css的代码。如果朋友们要用reset.css的话,也根据自己页面用到的标签,去设置相应的css reset代码。

body,h1,h2,h3,h4,h5,h6,p,blockquote,pre, /* structural elements 结构元素 */
dl,dd,ul,ol, /* list elements 列表元素 */
form,input,textarea,select,fieldset,legend,button, /* form elements 表单元素 */
{
margin:0;
}
body{font-size:12px; line-height:1.5; font-family:arial; color:#333;}
th,td,fieldset{padding:0;}
h1,h2,h3,h4,h5,h6{font-family:"Times New Roman",Simsun;}
input,textarea,select{font-size:12px;}
fieldset,img{border:none;}
ul,ol{padding-left:0; list-style:none;}
a{color:#333;text-decoration:none;}
a:hover{text-decoration:underline;}
table{border-collapse:collapse; border-spacing: 0;}
input[type="button"],input[type="submit"]{-webkit-appearance:none;}
input[type="text"]{border-radius:0;}

参考的地址:

http://shawphy.com/2009/03/my-own-reset-css.html

http://meyerweb.com/eric/tools/css/reset/index.html

http://yui.yahooapis.com/2.7.0/build/reset/reset.css

http://www.zhangxinxu.com/wordpress/2010/08/html5-css-reset/

http://www.blueidea.com/tech/web/2008/6165.asp

reset css,布布扣,bubuko.com

reset css

标签:style   blog   http   color   问题   for   

原文地址:http://www.cnblogs.com/sensualgirl/p/3837859.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!