热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

CSS之Rest(重置样式)推荐

CSSReset,意为重置默认样式。HTML中绝大部分标签元素在网页显示中都有一个默认属性值,通常为了避免重复定义元素样式,需要进行重置默认样式(CSSReset),本篇文章举了几个例子。
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: ””;
}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;
}

推荐教程:《CSS教程》

以上就是CSS之Rest(重置样式)推荐的详细内容,更多请关注 第一PHP社区 其它相关文章!


推荐阅读
  • 知识图谱——机器大脑中的知识库
    本文介绍了知识图谱在机器大脑中的应用,以及搜索引擎在知识图谱方面的发展。以谷歌知识图谱为例,说明了知识图谱的智能化特点。通过搜索引擎用户可以获取更加智能化的答案,如搜索关键词"Marie Curie",会得到居里夫人的详细信息以及与之相关的历史人物。知识图谱的出现引起了搜索引擎行业的变革,不仅美国的微软必应,中国的百度、搜狗等搜索引擎公司也纷纷推出了自己的知识图谱。 ... [详细]
  • 本文介绍了lua语言中闭包的特性及其在模式匹配、日期处理、编译和模块化等方面的应用。lua中的闭包是严格遵循词法定界的第一类值,函数可以作为变量自由传递,也可以作为参数传递给其他函数。这些特性使得lua语言具有极大的灵活性,为程序开发带来了便利。 ... [详细]
  • 基于layUI的图片上传前预览功能的2种实现方式
    本文介绍了基于layUI的图片上传前预览功能的两种实现方式:一种是使用blob+FileReader,另一种是使用layUI自带的参数。通过选择文件后点击文件名,在页面中间弹窗内预览图片。其中,layUI自带的参数实现了图片预览功能。该功能依赖于layUI的上传模块,并使用了blob和FileReader来读取本地文件并获取图像的base64编码。点击文件名时会执行See()函数。摘要长度为169字。 ... [详细]
  • 本文介绍了使用Java实现大数乘法的分治算法,包括输入数据的处理、普通大数乘法的结果和Karatsuba大数乘法的结果。通过改变long类型可以适应不同范围的大数乘法计算。 ... [详细]
  • HDU 2372 El Dorado(DP)的最长上升子序列长度求解方法
    本文介绍了解决HDU 2372 El Dorado问题的一种动态规划方法,通过循环k的方式求解最长上升子序列的长度。具体实现过程包括初始化dp数组、读取数列、计算最长上升子序列长度等步骤。 ... [详细]
  • 本文讨论了Alink回归预测的不完善问题,指出目前主要针对Python做案例,对其他语言支持不足。同时介绍了pom.xml文件的基本结构和使用方法,以及Maven的相关知识。最后,对Alink回归预测的未来发展提出了期待。 ... [详细]
  • 本文讨论了如何优化解决hdu 1003 java题目的动态规划方法,通过分析加法规则和最大和的性质,提出了一种优化的思路。具体方法是,当从1加到n为负时,即sum(1,n)sum(n,s),可以继续加法计算。同时,还考虑了两种特殊情况:都是负数的情况和有0的情况。最后,通过使用Scanner类来获取输入数据。 ... [详细]
  • 本文讲述了作者通过点火测试男友的性格和承受能力,以考验婚姻问题。作者故意不安慰男友并再次点火,观察他的反应。这个行为是善意的玩人,旨在了解男友的性格和避免婚姻问题。 ... [详细]
  • 本文介绍了通过ABAP开发往外网发邮件的需求,并提供了配置和代码整理的资料。其中包括了配置SAP邮件服务器的步骤和ABAP写发送邮件代码的过程。通过RZ10配置参数和icm/server_port_1的设定,可以实现向Sap User和外部邮件发送邮件的功能。希望对需要的开发人员有帮助。摘要长度:184字。 ... [详细]
  • 动态规划算法的基本步骤及最长递增子序列问题详解
    本文详细介绍了动态规划算法的基本步骤,包括划分阶段、选择状态、决策和状态转移方程,并以最长递增子序列问题为例进行了详细解析。动态规划算法的有效性依赖于问题本身所具有的最优子结构性质和子问题重叠性质。通过将子问题的解保存在一个表中,在以后尽可能多地利用这些子问题的解,从而提高算法的效率。 ... [详细]
  • Java验证码——kaptcha的使用配置及样式
    本文介绍了如何使用kaptcha库来实现Java验证码的配置和样式设置,包括pom.xml的依赖配置和web.xml中servlet的配置。 ... [详细]
  • 高质量SQL书写的30条建议
    本文提供了30条关于优化SQL的建议,包括避免使用select *,使用具体字段,以及使用limit 1等。这些建议是基于实际开发经验总结出来的,旨在帮助读者优化SQL查询。 ... [详细]
  • 本文介绍了指针的概念以及在函数调用时使用指针作为参数的情况。指针存放的是变量的地址,通过指针可以修改指针所指的变量的值。然而,如果想要修改指针的指向,就需要使用指针的引用。文章还通过一个简单的示例代码解释了指针的引用的使用方法,并思考了在修改指针的指向后,取指针的输出结果。 ... [详细]
  • 在project.properties添加#Projecttarget.targetandroid-19android.library.reference.1..Sliding ... [详细]
  • 猜字母游戏
    猜字母游戏猜字母游戏——设计数据结构猜字母游戏——设计程序结构猜字母游戏——实现字母生成方法猜字母游戏——实现字母检测方法猜字母游戏——实现主方法1猜字母游戏——设计数据结构1.1 ... [详细]
author-avatar
飞天猪的世界公寓
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有