梳理复位和基座的功效,而不是一个建立一个 [英] Efficacy of combinging reset and base, instead of building one off the other

查看:129
本文介绍了梳理复位和基座的功效,而不是一个建立一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我已经把复位和基地组合成一个邪恶的优化流线型smorgasbord。我发现它是一个真正的治疗,并想知道这是否是常见的做法。我的猜测是不...和是...

Recently I've taken to combining reset and base into one nefarious optimized streamlined smorgasbord. I'm finding it to be a real treat, and wonder if this is common practice. My guess is "no"...and "yes"...

也就是说,我的印象是,有些程序员对复位感到恼火,从头开始做一切。其他人喜欢基线的方便,但他们首先使用reset.css样式表,然后是一个风格化的base.css

That is, I'm under the impression that some programmers get annoyed with reset and like to do everything from scratch. Others like the convenience of a baseline, but they do it first with a reset.css stylesheet, followed with a stylized base.css

我的新方法将它们组合。

My new approach has them combined. One crude extracted example might illustrate.

上一次重置:

h1,h2,h3,h4,h5,h6{margin:0;padding:0;font-size:100%;font-weight:normal;}

上一个基础:

h1{font:bold 12px/16px "FancyAtFaceFont",Georgia,serif;margin:0 0 12px;}

但是看到字体和边缘样式?我完全不认为开发者会把它们加倍成这样的东西:

But see the doubling up there of font and margin styles? Am I totally way too nitpicky a developer for thinking of rather doubling them up into something like this:

h1{font:bold 12px/16px "FancyAtFaceFont",Georgia,serif;margin:0 0 12px;padding:0;}

实际上没有必要对前者进行复位,换句话说,在这种情况下。除了填充,一切已经被覆盖。这种技术简化了一切。唯一需要注意的是确保你为每个网站修改每个html标签。

There's effectively no need for the former reset, in this case, in other words. With the exception of the padding, everything was already being overridden. This technique streamlines everything. The only thing to watch for is to make sure that you refine each html tag for every site one does. But I find I do this work anyway.

推荐答案

你的技术实际上是许多人喜欢的。我倾向于不再使用重置,因为,像你一样,我发现定义一些好的基本样式是更有效和更容易管理。

Your technique is actually preferred by many people. I tend not to use resets anymore because, like you, I find that defining some good base styles is more efficient and easier to manage.

Johnathan Snook同意: http:// snook .ca / archives / html_and_css / no_css_reset / ,如果你正在寻找一个知名的网络专业人士,他将是一个相当不错的权威。

Johnathan Snook agrees: http://snook.ca/archives/html_and_css/no_css_reset/ and he would be a pretty good authority on the matter if you're looking for a well known web professional who agrees.

这篇关于梳理复位和基座的功效,而不是一个建立一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆