简体   繁体   中英

How do I get cross-browser consistency for spacing elements?

I wrote a little application that is an image slider with a couple logos on the top. The spacing is very important for this project, and it is inconsistent across browsers. I have no idea how to fix this, and I'm really stressing out.

This is what it should look like: http://i.imgur.com/ycyeH.jpg

Thank you so much for your help.

I have checked your CSS and I can't see any CSS reset statement in it. Different browsers have different defaults when it comes to undeclared margins or paddings etc. You could insert some statements by yourself at the top, such as

* {margin: 0px; padding: 0px}

but there might be other problems such as the different way overflow is managed etc.

So maybe the best option is to include a CSS reset from a library, such as

However, next time try to use jsfiddle as suggested in the other answer, or just learn how to include code here in the post, so we don't need to download archives to view your code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM