Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome/Safari ignoring my reset rules?

link text

In Safari/Chrome it has extra spacing on the left/top of ol's, blockquotes and other elements.

I can't isolate this, however when I look in the web inspector in Safari, its picking up a margin-left: of 26px on some elements. I have not specified any such rules, so is this a bug in Web inspector?

Can someone enlighten me as to why these exta spacing problems are occurring? Thanks!

like image 200
Chris J Allen Avatar asked Feb 09 '09 11:02

Chris J Allen


1 Answers

That margin-left:26px is the "computed style" of your styling margin-left:2em. Hence why it's under Computed Style section in Safari's Web Inspector. So if you change your margin-left to some other values the computed-style pixel value will also change too.

Anyway there are indeed extra padding! And it's caused by the user agent stylesheet (-webkit-padding-start:40px). Reset this style by setting padding:0 on your ol and any others elements you want.

A good way to prevent this problem from happening again and develop without worry is to reset your css. A basic reset would be:

* { margin:0; padding:0; }
like image 145
Jason Avatar answered Sep 24 '22 23:09

Jason