前端学习(94):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;
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/423252.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

设计模式笔记(24)---访问者模式(行为型)

Gof定义 表示一个作用于某对象结构中的各元素的操作。它可以在不改变各元素的类的前提下定义作用于这些元素的新的操作。 动机 在软件构建过程中,由于需求的改变,某些类层次结构中常常需要增加新的行为(方法),如果直接…

git 提交遇到error:fail to push some refer to 远程地址(url)

最近项目遇到一个问题,就是git 提交老是报错,但是在其他小伙伴,机器上没有事,调试了半天发现是git 提交时 -m ‘信息不能以“#”号开头’ 参考了下面博客,第一种操作方式: https://www.cnblogs.com/zndxal…

前端学习(95):ps基本操作与图片格式

jpg 色彩比较丰富 gif 动图 png 半透明 psd原始图片

【C++深度剖析教程23】继承中的访问级别

本C课程学习记录,完全来源于狄泰软件学院的相关课程,想一起学习的加我q1126137994或者q群199546072 给你推荐更多相关课程。 今天学习C中继承的访问级别。首先我们思考一个问题,子类是否可以直接访问父类的私有成员?&#xff1f…

C# 的Delegate(委托)

C# 是一个颇具争议的新兴语言,由 Microsoft 开发创造,以作为其 Visual Studio.NET 的基石,目前正处于第一个 Beta 版的发布阶段。C# 结合了源自 C 和 Java 的许多特性。Java 社群对 C# 主要的批评在于,其声称 C# 只是一个蹩脚的 J…

IT职业就业-学长有话说

首先说一下刚毕业的学生,刚毕业对于岗位,肯定是不清楚的,不如:研发和开发,研发是做产品,而开发可能是做项目,项目和产品差异特别大,项目经常在项目地,而产品大部分在公司…

【Makefile由浅入深完全学习记录1】认识make和makefile

学习交流加 个人qq: 1126137994个人微信: liu1126137994学习交流资源分享qq群: 962535112 今天开始学习项目又多了一项:Makefile由浅入深完全学习。之前做嵌入式Linux时,就一直在用make,但是对Makefile的理…

前端学习(96):切图流程

按下屏幕的prtscr 找到打开所在的文件 矩形框选中---ctrlc ---controlN------保存-----ctrlv 保存为jpg文件

kml的编写

kml由于其可以方便快捷的显示数据而越来越得到人们的喜爱,特别是可以借助Google earth快速的展示数据。kml的具体解释:KML,是 Keyhole 标记语言(Keyhole Markup Language)的缩写,是一种采用 XML 语法与格式…

java锁以及双重检查

双检锁/双重校验锁 双层对空判断困扰了很久。实例 public class Singleton {private volatile static Singleton singleton;//私有构造函数避免调用private Singleton (){}public static Singleton getSingleton() {// 先判断对象是否创建过if (singleton null) {//类对象加锁…

【C++深度剖析教程24】C++中不同的继承方式

过完年了,今天开始写博客记录学习的过程。继续C的学习,今天我们来看C中不同的继承方式。 一、初探继承的方式 从上图看,是否可以将继承中的public换成protected或者private。如果可以,它们与public继承的区别是什么? …

前端学习(97):psd切图流程

编辑----首选项---增效工具----启用生成器 文件---生成----图像资源 选择图层修改命名为png,则再默认路径下生成。 默认为半透明

JavaScript:constructor属性

constructor属性始终指向创建当前对象的构造函数。比如下面例子: //等价于 var foo new Array(1, 56, 34, 12); vararr [1, 56, 34, 12]; console.log(arr.constructor Array); //true //等价于 var foo new Function(); varFoo function() { }; console.log(Foo.…

IT职业就业-学长有话说(二)

对应刚毕业就人传统行业的,同学需要谨慎,因为传统公司的技术,基本上是一年或者两年,基本上就会遇到瓶颈,看上去,似乎已经掌握了,许多技术和框架,但是,相对于技术的深度确…

【C++深度剖析教程25】继承中的构造与析构

今天来学习C中继承的构造与析构,有兴趣一起学习的加qq:1126137994 1、问题 如何初始化父类成员?父类构造函数与子类构造函数有什么关系? 子类对象是如何构造的? 子类中可以定义构造函数子类构造函数必须对继承而来…

springboot创建子模块时遇到子模块覆盖父模块问题解决

1.最近更新git dev 开发分支需要添加一个子模块,创建过程中遇到 创建springboot 模块时,子模块覆盖了父模块,搞了半天,最后查询到解决办法如下: 1 多模块项目创建 因为本系列的下一篇是《Spring Boot集成Dubbo》&…

[MySQL] - 返回影响行数

(在MySQL 5.1.36上测试) found_rows() : selectrow_count() : insert update delete 注:需要配合相应的操作一起使用,否则返回的值只是1和-1(都是不正确的值) 示例: dropdatabaseifexistsmytest;createdatabasemytest;usemytest;droptableifexistsMyTestTable;createtableMyTe…

【C++深度剖析教程26】父子间的冲突

今天继续来学习C,父类与子类之间的冲突。加qq1126137994共同学习交流。 1、问题 子类中是否可以定义父类中的同名成员,如果可以,如何区分?如果不可以那又为什么? 2、问题的延伸 子类可以定义父类中的同名成员子类中…

java编程思想学习(1):抽象

今天开始java编程思想的导读,希望自己能更好的理解程序。全书1461页,恐怖,尽量一天看十页八。 OOP 面向对象程序设计 记录一点东西八 第一个小课程,抽象过程 看看概念 1万物皆为对象 2程序是对象的集合,他们通过…

嵌入式Linux系统之I.MX6触摸屏驱动程序TSC2007.C的分析、移植与校准

学习交流加 个人qq: 1126137994个人微信: liu1126137994学习交流资源分享qq群: 962535112 今天来记录一下I.MX6开发板移植触摸屏驱动程序的过程分析。在移植驱动程序之前,为了学习,先去分析一下触摸屏驱动程序的框架。…