CSS Reset(样式重置)

CSS Reset(样式重置)CSSReset,意为重置默认样式。HTML中绝大部分标签元素在网页显示中都有一个默认属性值,通常为了避免重复定义元素样式,需要进行重置默认样式(CSSReset)。举几个例子:1.淘宝(CSS

大家好,又见面了,我是你们的朋友全栈君。

CSS Reset,意为重置默认样式。HTML中绝大部分标签元素在网页显示中都有一个默认属性值,通常为了避免重复定义元素样式,需要进行重置默认样式(CSS Reset)。举几个例子:
1.淘宝(CSS Reset):
html {
overflow-x:auto;
overflow-y:scroll;
}
body, dl, dt, dd, ul, ol, li, pre, form, fieldset, input, p, blockquote, th, td {
font-weight:400;
margin:0;
padding:0;
}
h1, h2, h3, h4, h4, h5 {
margin:0;
padding:0;
}
body {
background-color:#FFFFFF;
color:#666666;
font-family:Helvetica,Arial,sans-serif;
font-size:12px;
padding:0 10px;
text-align:left;
}
select {
font-size:12px;
}
table {
border-collapse:collapse;
}
fieldset, img {
border:0 none;
}
fieldset {
margin:0;
padding:0;
}
fieldset p {
margin:0;
padding:0 0 0 8px;
}
legend {
display:none;
}
address, caption, em, strong, th, i {
font-style:normal;
font-weight:400;
}
table caption {
margin-left:-1px;
}
hr {
border-bottom:1px solid #FFFFFF;
border-top:1px solid #E4E4E4;
border-width:1px 0;
clear:both;
height:2px;
margin:5px 0;
overflow:hidden;
}
ol, ul {
list-style-image:none;
list-style-position:outside;
list-style-type:none;
}
caption, th {
text-align:left;
}
q:before, q:after, blockquote:before, blockquote:after {
content:””;
}
2.百度(CSS Reset):
body {
font-family:arial,helvetica,sans-serif;
font-size:13px;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:1.4;
text-align:center;
}
body, ul, ol, dl, dd, h1, h2, h3, h4, h5, h6, p, form, fieldset, legend, input, textarea, select, button, th, td {
margin:0;
padding:0;
}
h1, h2, h3, h4, h5, h6 {
font-size:100%;
font-weight:normal;
}
table {
font-size:inherit;
}
input, select {
font-family:arial,helvetica,clean,sans-serif;
font-size:100%;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:normal;
}
button {
overflow:visible;
}
th, em, strong, b, address, cite {
font-style:normal;
font-weight:normal;
}
li {
list-style-image:none;
list-style-position:outside;
list-style-type:none;
}
img, fieldset {
border:0 none;
}
ins {
text-decoration:none;
}
3.《超越css》(CSS Reset):
/* Normalizes margin,padding */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td { margin:0;padding:0}
/* Normalizes font-size for headers */
h1,h2,h3,h4,h5,h6 { font-size:100%}
/* Removes list-style from lists */
ol,ul { list-style:none }
/* Normalizes font-size and font-weight to normal */
address,caption,cite,code,dfn,em,strong,th,var { font-size:normal; font-weight:normal }
/* Removes list-style from lists */
table { border-collapse:collapse; border-spacing:0 }
/* Removes border from fieldset and img */
fieldset,img { border:0 }
/* Left-aligns text in caption and th */
caption,th { text-align:left }
/* Removes quotation marks from q */
q:before,q:after { content:”}
4.Eric Meyer(CSS Reset)——推荐:
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, img, ins, 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 {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: ”;
content: none;
}
/* remember to define focus styles! */
:focus {
outline: 0;
}
/* remember to highlight inserts somehow! */
ins {
text-decoration: none;
}
del {
text-decoration: line-through;
}
/* tables still need ‘cellspacing=”0″‘ in the markup */
table {
border-collapse: collapse;
border-spacing: 0;
}
5.YUI(CSS Reset):
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
margin:0;
padding:0;
}
table {
border-collapse:collapse;
border-spacing:0;
}
fieldset,img {
border:0;
}
address,caption,cite,code,dfn,em,strong,th,var {
font-style:normal;
font-weight:normal;
}
ol,ul {
list-style:none;
}
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;
}
———————
作者:Eason_Severus
来源:CSDN
原文:https://blog.csdn.net/eason_severus/article/details/53665074
版权声明:本文为博主原创文章,转载请附上博文链接!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/155178.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • Mac下homebrew安装

    Mac下homebrew安装需要替换国内镜像 usr bin ruby e curl fsSLhttps cdn jsdelivr net gh ineo6 homebrew install install 该脚本用了中科大镜像加速访问 仅修改仓库地址部分 不会产生安全隐患 关于中科大所提供的 Homebrew 镜像服务 https lug ustc edu cn wiki mirrors help brew git 以下是中科大的 Homebrew 安装帮助 Homebrew

    2025年8月5日
    3
  • 北京2018积分落户名单[通俗易懂]

    北京2018积分落户名单[通俗易懂]北京2018积分落户名单已经公示出来了,地址在北京人力和社会保障局官网,共有6019人获得,恭喜他们,最低分为90.75分。Update:2019年的也出来了,详情请见https://blog.csdn.net/minstyrain/article/details/102642906.网站每页只能显示100页的内容,浏览起来很不方便,这里提供完整的excel表格形式的数据,详见百度网盘(…

    2022年10月6日
    3
  • 微视的特效怎么弄的_微视入口

    微视的特效怎么弄的_微视入口欢迎大家前往"腾讯云+社区",获取更多腾讯海量技术实践干货哦~本文由"腾讯视频云终端团队"发表于"云+社区专栏"常青,20

    2022年8月6日
    5
  • python的jieba库教程_python下载jieba库

    python的jieba库教程_python下载jieba库jieba是python的一个中文分词库,下面介绍它的使用方法。安装方式1:pipinstalljieba方式2:先下载http://pypi.python.org/pypi/jieba/然后解压,运行pythonsetup.pyinstall功能下面介绍下jieba的主要功能,具体信息可参考github文档:https://github.com/fxsjy/jieba分词jieba常用的三种模式:精确模式,试图将句子最精确地切开,适合文本分析; 全模式

    2025年11月22日
    3
  • Java学习代码合集

    Java学习代码合集其实我学习java最根本的原因是:我是一个挺关注外在的人,虽然是个程序员,所以我很喜欢写出那些带有漂亮的界面的程序,因为C总是控制台,我不是很喜欢,在这份java代码合集中,我会记录自己学习Java界面化编程的点点滴滴。更新:因为C/C++是我主要使用语言,所有后来写界面主要用Qt写了,但我java也会继续学的。我只是给想学界面gui的同志一个思路。可以参考这篇文章Qt5计算器的实现可能…

    2022年5月8日
    42
  • bt种子天堂_虫部落搜索引擎大全

    bt种子天堂_虫部落搜索引擎大全本来这个技术含量不足以写进博客的,不过想想好久不写博客都快把markdown语法忘了(汗颜),之前做的信安比赛的项目未来会写一篇总结。代码比较短,直接就着代码加注释讲吧:下载后如下:具体的使用方

    2022年8月5日
    6

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号