Jump to content

My CSS is different in IE, Chrome and Safari.


webmaster1

Recommended Posts

This is ridiculous. I feel like I've woken up into a twilight zone. With all the technology and intellects in the world how come we still don't have a unified rendering of CSS by all browsers.

 

I've tried IE, Chrome and Safari each of which return different results by a few pixels here and a few pixels there. So I know the results are differnet but where do I start in fixing it?

 

Does anybody have general pointers in making cross-browser CSS?

Link to comment
Share on other sites

Try and access the robots.txt file directly and see if it pops up.

 

Anyways, there are three steps you should definitely take to unify your site across browsers:

 

1) Always have a doctype. If you don't, IE will go into quirks mode which will cause strange things to happen.

2) Use a CSS reset sheet. This sets the defaults for all elements, rather than relying on the browsers' defaults. As different browsers set defaults differently, this puts you on a level playing field, since it explicitly defines the defaults, overriding any browser defaults.

3) Make sure your code is valid. Browsers each have their own methods of interpreting errors, and because they are errors, there is no standard as to how they should be interpreted. However, for the most part (i.e. with the exception of IE), they interpret code the same way, so if it looks ok in Firefox for example, it will probably be ok in Safari as well. There are some minor exceptions, but for the most part it will be the same.

 

 

If you do these three things, it by no means will guarantee your site will be the same on all browsers, but it gives you a really strong foundation to start from in trying to fix the differences. If you haven't done the above three things, the differences are going to be significantly harder to fix.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.