css reset css重置分享

本文详细介绍了CSS Reset的作用及其具体实现方式,包括对各种HTML元素默认样式的重置,并提供了全局属性定义,如字体大小、颜色等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
caption{margin:0; padding:0; border:0; outline:0; font-weight:inherit; font-style:inherit; font-family:inherit;  vertical-align:baseline}

ol, ul{list-style:none}
table{border-collapse:separate; border-spacing:0}
caption, th, td{text-align:left; font-weight:normal}
blockquote:before, blockquote:after,
q:before, q:after{content:""}
blockquote, q{quotes:""""}

注意以上css reset没有将table的相关标签列出进来,原因是会和一些在线编辑器看到的效果冲突。

以下为css全局属性定义,主要将一些常用的css属性写出来:

/*--全局标签--*/
body { color: #2b2b2b; font-family: Arial, Helvetica, sans-serif}
img { border: none}
a { color: #2b2b2b; text-decoration: none}
a:hover { color: #c00; text-decoration: underline}

/*--全局类--*/
/*--布局类--*/
.clear{ clear: both; margin: 0; padding: 0; height: 0; font-size: 0; line-height: 0; overflow: hidden} /*---用来清除浮动的div---*/
.left { float: left} /*---常用的左浮动---*/
.right { float: right} /*---常用的右浮动---*/
.tleft { text-align: left} /*---常用的居左---*/
.tcenter { text-align: center}/*---常用的居中---*/
.tright { text-align: right} /*---常用的居右---*/
/*--字体类--*/
.font12 { font-size: 12px}
.font14 { font-size: 14px}
.font16 { font-size: 16px}
.font18 { font-size: 18px}
.font20 { font-size: 20px}
.fb { font-weight: bold}
.fu { text-decoration: underline}
.fn { text-decoration: none}
/*--颜色类(常修改增加)--*/
.cred, a.cred:link, a.cred:visited, a.cred:hover { color: #c00}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值