Does Chrome / Safari ignore my reset rules?

link text

In Safari / Chrome, it has an extra distance to the left / top of ol, blockquotes and other elements.

I cannot isolate this, however, when I look in the web inspector in Safari, it draws the left edge: 26 pixels on some elements. I did not specify any such rules, so is this a bug in the web inspector?

Can someone enlighten me about why these problems with widening the gap occur? Thanks!

+6
css google-chrome safari
source share
1 answer

This margin-left: 26px is the "calculated style" of your design margin - left: 2em. Therefore, why is it in the Computed Style section of the Safari Web Inspector. Therefore, if you change the margin on the left to some other values, the pixel value in the computed style will also change.

In any case, there really is an additional supplement! And this is caused by the user agent stylesheet (-webkit-padding-start: 40px). Reset this style by installing the addition: 0 on your ol and any other elements you want.

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

* { margin:0; padding:0; } 
+14
source share

All Articles