css学习笔记: 重置默认样式 css reset(2)
作者:好好 来源:好好blog 发布时间:2009-07-19 14:30:00
在《超越css》一书中建议我们做网站开始重置所有默认样式:
/* 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:''}
那我们实际写代码的时候该怎么来css reset呢?
我个人推荐使用(Eric Meyer和YUI)的 css reset
Eric Meyer's 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;
}
YUI:
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 reset写法,再根据自己的实际情况,一定能写出符合自己网站的完美的css reset。


猜你喜欢
- 上个月就打算开发个还算好玩的项目,但是一直没时间。这篇是此项目用到的一部分,处理好此部分基本还差通信等方面的了。首先模拟鼠标键盘按下释放的动
- 相关的OBJECTPROPERTY可参考:http://msdn.microsoft.com/en-us/library/ms176105.
- 一、代码注释介绍注释就是对代码的解释和说明,其目的是让人们能够更加轻松地了解代码。注释是编写程序时,写程序的人给一个语句、程序段、函数等的解
- 我就废话不多说了,大家还是直接看代码吧~import tensorflow as tfimport syswith tf.variable_
- 废话不多说1.win+R 启动“运行”输入cmd 点确定2.输入 cd /d xxxxxxx回车jupyter notebook回车在这里我
- 表格制作好了,内容也有了,怎么看着别扭呀!哦,还没有给表格化化装--格式化表格呀,俗话说:人靠衣服也靠鞍,要想让你制作的网页漂漂亮亮、美观大
- py2exe在sourceforge 的下载只支持到2.7。针对python3.0+的版本,需要自己编译。1.下载源码svn checkou
- 介绍 itertools是python内置的模块,使用简单且功能强大,这里尝试汇
- 左右结构是平常页面中最经常看到的结构,简洁一些的页面就会使用边框将左右两边隔开,但往往由于左右两边的内容可能是不等高的,所以就会有一高一低的
- 1、、软件环境:Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-32-generic x86_64)MySQL 5
- 前言MySQL在2016年仍然保持强劲的数据库流行度增长趋势。越来越多的客户将自己的应用建立在MySQL数据库之上,甚至是从Oracle迁移
- 前言昨天写小项目的时候遇到了一个需求:把txt文档的数据导入到mysql数据库中,开始本来想直接用Mysql Workbench导入TXT文
- 这里只列举了部分方法,其他方法或python库暂时还没使用到1.不用库,直接打印:代码样例:import time#demo1def pro
- 前言:写小程序时,遇到个需要自定义回归时间的场景,下面是实现的效果图。 于我需求而言,我只需要用到fixed_in
- 通常情况睛,SQLServer2000正在使用的数据库(有数据库连接),是不能删除或被恢复的,可以将数据库设置为单用户模式,即可删除: AL
- QComboBox 是一个允许用户从列表选项中选择一项的控件。#!/usr/bin/python3# -*- coding: utf-8 -
- 一.克隆表法一mysql> create table info1 like info;复制格式,通过LIKE方法,复制info表结构生
- 在对数值进行格式化的时候,一个常见的问题是按照千分位格式化,网上对这个问题已经有很多种解决方法了,还可以利用Array.prototype.
- 如果你从未为MySQL设置根用户密码,服务器在以根用户身份进行连接时不需要密码。但是,建议你为每个账户设置密码。如果你以前设置了根用户密码,
- 功能要求这是我们老师的作业 代码中都有注释 要求 词频统计软件:1)从文本中读入数据:(文件的输入输出)2)不区分大小写,去除特殊字符。3)