Display: table adds padding / margin in webkit browsers but not FF or IE

I am working on some windows where I have to use the following css in a div so that it looks right:

display: table;

It works fine in Firefox + Internet Explorer, but I just noticed that it adds a 1px / margin / padding border in webkit browsers (Safari / Chrome), which moves the block a bit ... How can I get rid of this?

I downloaded an example drawing of how it was displayed:

http://imageshack.us/photo/my-images/854/examplez.jpg/

Is there a “simple way” to define in the stylesheet whether you use webkit or not? Because then I could just add "margin-left: -1px". I know there is a way to determine the type of browser in jQuery, but I think it might be redundant for this.

+5
source share

All Articles