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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • Java三大特征

    Java三大特征Java面向对象的三大特征:封装、继承、多态封装和继承几乎都是为多态而准备的一、     封装首先,属性能够描述事物的特征,方法能够描述事物的动作。封装就是把同一类事物的共性(包括属性和方法)归到同一类中,方便使用。封装:封装也称信息隐藏,是指利用抽象数据类型把数据和基于数据的操作封装起来,使其成为一个不可分割的整体,数据隐藏在抽象数据内部,尽可能的隐藏数

    2022年7月7日
    19
  • redis如何设置密码及验证密码_无线密码忘记了怎么在手机上查看

    redis如何设置密码及验证密码_无线密码忘记了怎么在手机上查看一、前言对于redis而言,其并没有实现访问控制这个功能,但是可以提供一个轻量级的auth认证方式。可以通过编辑对应的redis配置文件。redis.conf来启动二、设置密码1、找到redis的配置文件redis.conf配置文件中的参数:requirepass,就是配置redis访问密码的参数;#默认情况下,是注释的requirepassxxxx;设置requirepass密码如下。2、然后需要重启下redis服务,才能生效#1、kill掉redis进程#2、启动re

    2022年9月6日
    2
  • 靠!我被项目经理和同事嘲笑了,因为不会远程debug调试…「建议收藏」

    大家好,我是曹尼玛,刚从培训机构毕业,去一家单位上班一周了…这一周项目经理让我熟悉了项目业务,架构和设计,不算难,凭借我培训机构第一名的成绩,还是很顺溜。今天项目经理把同事们叫到一起,说线上438×6项目出现奇葩问题,但是开发环境初步测试没问题,需要配合测试部的小姐姐们在测试环境远程debug跟踪下,排查下问题,以及正式环境日志也会提供,重现下问题,解决下bug;项目经理见我这几天比较悠闲所以就对我说,“曹尼玛,这个小任务就交给你了”“我,我,我,我不会远程debug,没听过什么是远程d.

    2022年4月6日
    46
  • js操作string它substr方法

    js操作string它substr方法

    2022年1月1日
    51
  • php sigpipe,遭遇SIGPIPE[转]

    php sigpipe,遭遇SIGPIPE[转]转自:http://www.diybl.com/course/3_program/c++/cppjs/20090831/173152.html我写了一个服务器程序,在Windows下在cygwin环境编译后执行,然后用C#写了多线程客户端进行压力测试.程序一直运行正常.但当在Linux下测试时,总是莫名退出.最后跟踪到是write调用导致退出.用gdb执行程序,退出时提示”Broken…

    2022年5月30日
    33
  • GPS数据包格式+数据解析[通俗易懂]

    GPS数据包格式+数据解析[通俗易懂]全球时区的划分:  每个时区跨15°经度。以0°经线为界向东向西各划出7.5°经度,作为0时区。即0时区的经度范围是7.5°W——7.5°E。从7.5°E与7.5°W分别向东、向西每15°经度划分为一个时区,直到东11区和西11区。东11区最东部的经度是172.5°E,由172.5°E——180°之间就是东12区。西11区最西部的经度是172.5°W,由172.5°W——180°之间就是西12区。东

    2022年6月29日
    57

发表回复

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

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