Default css

We had a discussion at work about what the default margin is for p, h1 and table etc. Do you know? It was not like we thought. I thought that there is about 10px above and under most elements, this would add up to 20px which it is when you have an unstyled document.

I did some googling and found a great article over at Eric’s blog. He points out that you can take a look at the default CSS in some browsers, for example Firefox and Safari. Just search your harddrive for HTML.css and you’ll find it in one of your browsers folder.

Well, I found out that h1 has an margin-top of 0.67 ems. So I was completely wrong. The smaller heading there is the larger the top margin gets. p also has an top margin of 1.0 ems.

There was also some tips about unstyling the default CSS and one thing I never thought about is that you can set title, style and meta to display: block to see what is in the head of the document. Kind of cool.

Related Posts:

  • None

External links

Leave a Reply


Jens Wedin Mail me Portfolio