CSS reset CSS重置,YAHOO的YUI CSS RESET

 CSS  2018-12-05  admin  3369  4548

CSS reset CSS重置,YAHOO的YUI CSS RESET

每一个浏览器都有自己默认的设置,基础CSS重置可以删除浏览器提供的HTML元素的不一致样式。这创造了一个可靠的平坦的基础。加载CSS重置,编写您的项目需要的显式CSS。

当浏览器在元素的margins,line-heights,padding这些赋值的时候。如果时刻都写入布局中,网站会显得很粗糙。
这个reset方式很简单,并且极其的好用。它覆盖了所有浏览器的默认值,并且使各个浏览器都使用同样的数值。大量的使用  *{margin:0;padding:0}的时代已经过去了。使用reset可以更加的深入程序逻辑中。

官网:https://yuilibrary.com/yui/docs/cssreset/

cssreset.css

未压缩版:http://yui.yahooapis.com/3.18.1/build/cssreset/cssreset.css

压缩版:

<link rel = “stylesheet” type = “text / css” href = “http://yui.yahooapis.com/3.18.1/build/cssreset/cssreset-min.css” > 

/*
YUI 3.18.1 (build f7e7bcb)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/

/*
	TODO will need to remove settings on HTML since we can't namespace it.
	TODO with the prefix, should I group by selector or property for weight savings?
*/
html{
	color:#000;
	background:#FFF;
}
/*
	TODO remove settings on BODY since we can't namespace it.
*/
/*
	TODO test putting a class on HEAD.
		- Fails on FF.
*/
body,
div,
dl,
dt,
dd,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
code,
form,
fieldset,
legend,
input,
textarea,
p,
blockquote,
th,
td {
	margin:0;
	padding:0;
}
table {
	border-collapse:collapse;
	border-spacing:0;
}
fieldset,
img {
	border:0;
}
/*
	TODO think about hanlding inheritence differently, maybe letting IE6 fail a bit...
*/
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;
	font-variant:normal;
}
/* to preserve line-height and selector appearance */
sup {
	vertical-align:text-top;
}
sub {
	vertical-align:text-bottom;
}
input,
textarea,
select {
	font-family:inherit;
	font-size:inherit;
	font-weight:inherit;
	*font-size:100%; /*to enable resizing for IE*/
}
/*because legend doesn't inherit in IE */
legend {
	color:#000;
}

/* YUI CSS Detection Stamp */
#yui3-css-stamp.cssreset { display: none; }


如果文章对您有帮助,点击下方的广告,支持一下作者吧!

相关推荐


Systemd Web 管理系统:简化服务管理

# Systemd Web Systemd Web 是一个 Systemd 的 Web UI 管理系统,通过直观的界面和易用的操作,让用户能够轻松地管理 Linux 系统和服务。该项目旨在简化 Systemd 的使用,使得无论是专业的系统管理员还是普通的用户,都能够方便地对系统进行操作。 ## [github地址] (https://github.com/topascend/systemd

vue3 路由的简单使用

src/router/index.jsimport{createRouter,createWebHashHistory}from&#39;vue-router&#39; importIndexfrom&quot;@/views/Index&quot;; importHomefrom&quot;@/views/Home&quot;; importAboutfrom&quot;@/views

Go语言GUI/图形/图像相关的Go项目列表

Go语言GUI/图形/图像相关的Go项目列表

活动倒计时精准倒计时

活动倒计时精准倒计时,秒杀活动倒计时,服务器时间,计算倒计时