开发者

Efficacy of combinging reset and base, instead of building one off the other

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"...

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.

Previous reset:

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

Previous base:

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 开发者_StackOverflow社区like this:

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

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.

What say ye?


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 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜