css reset样式重置介绍 重置css样式工具分享
网站建设 2023-01-28 21:39www.1681989.com免费网站
最常用的CSS Reset:
复制代码
代码如下:{
marg:0;
paddg:0;
}
通过遍历DOM树将内外边距重置为0 但从性能与功能上都还有所不足
介绍两个比较不错的Reset.css 分别来自雅虎YUI和Eric Meyer
建议根据自己的项目精简
雅虎YUI 3.8.0 Reset.css
复制代码
代码如下:/
YUI 3.8.0 (build 5744)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.</p> <p><a href="http://yuilibrary./license/">http://yuilibrary./license/</a></p> <p>/
/
TODO will need to remove settgs on HTML sce we can't namespace it.
TODO with the prefix, should I group by selector or property for weight savgs?
/
html{
color:#000;
background:#FFF;
}
/
TODO remove settgs on BODY sce we can't namespace it.
/
/
TODO test puttg a class on HEAD.
- Fails on FF.
/
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,
form,fieldset,legend,put,textarea,p,blockquote,th,td {
marg:0;
paddg:0;
}
table {
border-collapse:collapse;
border-spacg:0;
}
fieldset,img {
border:0;
}
/
TODO thk about hanldg heritence differently, maybe lettg IE6 fail a bit...
/
address,caption,cite,code,dfn,em,strong,th,var {
font-style:normal;
font-weight:normal;
}</p> <p>ol,ul {
list-style:none;
}</p> <p>caption,th {
text-align:left;
}
h1,h2,h3,h4,h5,h6 {
font-size:100%;
font-weight:normal;
}
q:before,q:after {
content:'';
}
abbr,acronym {
border:0;
font-variant:normal;
}
/ to preserve le-height and selector appearance /
sup {
vertical-align:text-;
}
sub {
vertical-align:text-bottom;
}
put,textarea,select {
font-family:herit;
font-size:herit;
font-weight:herit;
}
/to enable resizg for IE/
put,textarea,select {
font-size:100%;
}
/because legend doesn't herit IE /
legend {
color:#000;
}
/ YUI CSS Detection Stamp /
#yui3-css-stamp.cssreset { display: none; }
Eric Meyer’s Reset CSS v2.0
复制代码
代码如下:/ <a href="http://meyerweb./eric/tools/css/reset/">http://meyerweb./eric/tools/css/reset/</a>
v2.0 | 20110126
License: none (public doma)
/</p> <p>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, img, s, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
marg: 0;
paddg: 0;
border: 0;
font-size: 100%;
font: herit;
vertical-align: basele;
}
/ HTML5 display-role reset for older browsers /
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
le-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacg: 0;
}
在你的网页代码中引入这样的样式就可以使用了。
网站设计
- 静宁会SEO的网站建设公司:全面提升您的网络影
- 提升在线业务的关键:选择最佳的丽水网站建设
- 浙江网站优化发展潜力如何
- 井研专业的网站建设公司:打造您的在线品牌
- 灵山SEO网站建设公司:提升您的在线业务表现
- 蒙城网站建设优化公司:提升您网站表现的理想
- 阳谷企业网站优化:提升线上业务力的关键
- 樟树专业的网站建设公司:打造您在线业务的坚
- 通河百度SEO排名的策略与技巧
- 重庆百度快照排名如何进行精准的客户引流
- 重庆百度快照排名
- 常宁便宜的建站公司:助您轻松打造在线业务
- 巫溪百度网站优化:提升网站曝光率与流量的关
- 湖北整站优化怎么做才能放大客户需求
- 闸北网站建设多少钱?全面解析与预算规划
- 辽宁企业网站优化怎么做电话营销