{Carrer web log} ←
CSS Mini Reset
Thursday, May 20, 2010 { 25 Comments }
What is CSS Reset?CSS Reset usually aims to reduce browser inconsistencies by evening up the CSS default settings in all browsers.
The most used CSS Rests are
Last week I spotted "CSS Reset – a simpler option" by Russ Weakley.
Russ made few smart observations: we don’t always need complete CSS reset because CSS Reset file can become very large and we often forget to set all the styles.
Also in my opinion we don’t always use all the CSS and HTML tags, when was the last time when you used “address” tag?
In many cases the complete CSS Reset makes perfect sense like in the case of some CSS Framework.
I used Eric Meyer Reset for my CSS Framework (Emastic and The Golden Grid).
In other my project complete CSS reset doesn’t make sense (Malo, Formy, 1 line CSS Framework).
My point is different projects(sites) can be approached differently, and not always we need complete CSS reset.
I wanted to make Mini CSS Reset who will focus on the main CSS features like Divs , Tables and Forms who are also the most used CSS(HTML) elements.
And here is the result:
/* CSS Mini Reset */
html, body, div, form, fieldset, legend, label
{
margin: 0;
padding: 0;
}
table
{
border-collapse: collapse;
border-spacing: 0;
}
th, td
{
text-align: left;
vertical-align: top;
}
h1, h2, h3, h4, h5, h6, th, td, caption { font-weight:normal; }
img { border: 0; }
You can compare:
You can use CSS Mini Reset when you actually don’t want to reset everything just the fundamental HTML elements.
Fork - Download CSS Mini Reset on github
Any suggestions?
25 Responses to “CSS Mini Reset”
-
// Unknown
// 5/20/2010
I agree that less is sometimes best for resetting CSS. I have my own customized reset I use specifically when working on CSS for sites using our Content Management System.
My guess is that other people will start coming up with their own resets as they start to figure out what elements they use the most.
Great post! - // // 5/20/2010
-
// Vladimir
// 5/20/2010
@Anonymous:
This is not complete reset, this is more structural reset. It resets only the skeleton of the web structure. If you are more fan of typographical reset here is one http://code.google.com/p/azbuka/ that I made. Or the big list of many different resets http://perishablepress.com/press/2007/10/23/a-killer-collection-of-global-css-reset-styles/. - // luminarious // 5/20/2010
- // Tony Dunsworth // 5/20/2010
-
// Marge-Bob
// 5/20/2010
I like the idea of this reset, but it's missing content tags. But I wonder if that's because those tags are actually the same across all browsers? For good measure I might throw in:
p { margin-bottom: 1em; }
I had planned on writing more...but in fact, that's the only block-level content tag in HTML4 other than UL (which I need to research more before resetting).
I'm planning on rewriting a legacy stylesheet and I think I'll use this wonderful mini-reset. Thank you! -
// J.
// 5/20/2010
@author : The only thing i would add to your reset would be the all around list <ul> in the first part of your css (padding and margin to 0)
@luminarious : Its a pretty convenient reset for short pages, in some case, where you have long pages, your reset will slow down the render of the css of your whole document since the universal selector (*) force the browser to cycle through all HTML tags - // // 5/20/2010
- // Rahul - Web Guru // 5/20/2010
- // Corey Ballou // 5/20/2010
- // // 5/21/2010
- // Andrew Worcester // 5/21/2010
- // Vladimir // 5/21/2010
- // // 5/21/2010
-
// Ethan
// 5/22/2010
I think the idea of finding a smaller reset is misguided in almost all cases. When you gzip and minify your CSS, the performance difference between resets is incredibly minimal (even if you count the few extra milliseconds that it takes the browser to apply the additional rules found in more complicated resets).
And, for that negligible loss in performance, you get a lot of convenience. The writer asked (rhetorically) when I last used an address tag and, while I don't use them often, I happened to use one today. Had that caused problems, it would've taken me time to fix and, ironically, adding the tag to the reset would invalidate the stylesheet, so users who had it cached would have to redownload it. Even if only a small percentage of users had it cached, the cost of downloading an entire new file could outweigh the performance gained initially. - // Ethan // 5/22/2010
-
// Vladimir
// 5/22/2010
@ETHAN : Don't get me wrong I have nothing against the complete reset. I think that there is no write or wrong Reset and is totally OK if you even don't use CSS Reset at all. With Mini CSS Reset I wanted to "fix" only the most critical fundamental parts of the CSS.
It is not all about the performance for me is like when you build a building if the main structure is solid the building will hold even if there is small earthquake. -
// proghead
// 5/22/2010
Until HTML 5 is supported everywhere i like to add rules for the new elements to my reset styles.
- // Vladimir // 5/22/2010
- // Beben Koben // 5/22/2010
- // // 5/25/2010
- // Unknown // 5/26/2010
- // George G // 12/05/2010
- // ghazals sms // 9/16/2011
-
// giveaboneadog
// 2/06/2013
Great stuff, I think resets should be done on a per-project basis, but of course, you don't always have time for that..
Here is my starting reset:
*{
box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
-o-box-sizing: border-box;
}
I personally couldn't live without it. Not literally.
<< Home
About Me <<<
Name: Vladimir Carrer
vladocar [at] gmail.com
Location: Verona, Italy
I'm a web designer, developer, teacher, speaker, generally web addicted ...
My projects <<<
- AI Prompt Directory
- Hand Drawn Icons
- Font Design Inspiration
- Font Pairings
- Free SVG Cut File
- Upcoming NFT projects
- Discord Tutorials
- Free Sublimation Designs
- Tech Feed
- MySQL Lite Administrator
- Quark Mini PHP CMS
- Formy - CSS Form Framework
- Emastic - CSS Framework
- Malo - CSS Library
- The Golden Grid
- 1 line CSS Grid Framework
- Two Lines CSS Framework
- Child Selector System - CSS Framework
- Better Web Readability Project
- Azbuka - CSS Typographical Base Rendering Library
- ClipR - bookmarklet for better reading
- CSS3 Action Framework
- CSS Mini Reset
- HTML5 Mini Template
- CSS Mobile Reset
- picoCSS - JavaScript Framework
- HTML Lorem Ipsum Crash Test
- Object Auto Documentation - JavaScript
- o - JS Library for Object Manipulation
- Foxy - CSS Framework
- Tumblr Free Theme - Better Readability Project
- Box - CSS Framework
- SMART CSS GRID
- nanoJS - Minimal JS DOM Library
- Flexy CSS Framework
- Katana is CSS Layout System made with Flexbox
- Micro CSS Reset
- 60 Grid System
- Simple CSS Button
- ramd.js JavaScript library for making web applications.
- Minimal Notes web app build with Vue.js
- Scribble Font for Prototyping & Wireframing
- Flex One - 1 CSS Class System
- Floaty - CSS Float Based Layout System
- Infinity CSS Grid
- CLI Convert websites into readable PDFs
- keywords-extract - CLI tool, extract keywords from any web page.
- screenshoteer - Make website screenshots and mobile emulations from the command line.
- Basic.css - Classless CSS Starter File
§§Previous Posts <<<
- CSS vendor prefixes – Can we all get along
- CSS3 Action Framework
- Minimalistic Wallpaper for iPad
- Photoshop glyphs tester
- Hacker News mini Redesign [Unofficial]
- ClipR - bookmarklet for better internet reading
- About the 80 million dollars Blue (#0044cc)
- Opera 10.50 for one week - Summary
- Initiative - Opera 10.50 for one week
- Quark – mini php CMS
Other Profiles <<<
Content is licensed under a Creative Commons Public Domain License