Skip to content

Commit 4e9de42

Browse files
committed
First Commit
1 parent 6fabd4b commit 4e9de42

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# CSS Micro Reset
2+
3+
You probably don't need CSS Reset, at least not complete CSS Reset.
4+
5+
Every Browser has it's own CSS Reset. Reseting it again means that later you need to set all reseted elements.
6+
7+
Basically you have Browser Reset -> Your Reset -> Setting all Reseted Elements -> probably another styling at the end.
8+
9+
Let take typical H1 tag mistake:
10+
11+
```css
12+
/* Chrome Reset */
13+
14+
h1 {
15+
display: block;
16+
font-size: 2em;
17+
-webkit-margin-before: 0.67em;
18+
-webkit-margin-after: 0.67em;
19+
-webkit-margin-start: 0px;
20+
-webkit-margin-end: 0px;
21+
font-weight: bold;
22+
}
23+
24+
/* Your Reset */
25+
26+
h1 {
27+
margin: 0;
28+
padding: 0;
29+
border: 0;
30+
line-height: 1;
31+
font-weight: normal;
32+
33+
}
34+
35+
/* Now you need to set the H1 */
36+
37+
h1 {
38+
margin: 0 0 0 1em;
39+
line-height: 1.5;
40+
font-weight: normal;
41+
}
42+
43+
/* And probably you will do one more H1 setting */
44+
45+
h1 {
46+
color: #111;
47+
font: 2em/1.5 Arial, sans-serif;
48+
font-weight: normal;
49+
}
50+
51+
/* I will assume one or two more setting of H1 tag here :) */
52+
```
53+
**We all did this mistake too many times.**
54+
55+
Why not skip the reset and set just the elements you need for your project?
56+
57+
Also why reseting some elements if you are not using them in your project. Example: If you don't have forms in your project don't reset them.
58+
59+
Other thing: It's Ok some elements to be different in different browsers.
60+
61+
Why not start with bare bones reset and if needed add some elements?
62+
63+
I've did just that: **Micro CSS Reset**
64+
65+
Feel free to add or remove elements to Micro CSS Reset, don't just blindly use it. Example: if don't use tables remove all the table related tags in the Micro CSS Reset.
66+
67+
*Like I said in the beginning: You may not need this or any other CSS reset. Before use understand what this reset does.*

micro-css-reset.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* CSS Micro Reset */
2+
3+
body { margin: 0 }
4+
5+
h1, h2, h3, h4, h5, h6 { font-weight:normal }
6+
7+
table
8+
{
9+
border-collapse: collapse;
10+
border-spacing: 0
11+
}
12+
13+
th, td
14+
{
15+
text-align: left;
16+
vertical-align: top
17+
}
18+
19+
img, iframe { border: 0 }

0 commit comments

Comments
 (0)