Users typically view your website using a browser. Each browser interprets your website code in a slightly different manner, which means that it may appear differently to visitors using different browsers. In general, avoid relying on browser specific behavior, such as relying on a browser to correctly detect a content-type or encoding when you did not specify one. In addition, there are some steps you can take to make sure your site doesn't behave in unexpected ways.
Test your site in as many browsers as possible
Once you've created your web design, review your site's appearance and functionality on multiple browsers to make sure that all your visitors are getting the experience you worked so hard to design. Ideally, start testing as early in your site development process as possible. Different browsers - and even different versions of the same browser - can see your site differently. You can use services such as Google Analytics to get a good idea of the most popular browsers used to view your site.
Write good, clean HTML
While your site may appear correctly in some browsers even if your HTML is not valid, there's no guarantee that it will appear correctly in all browsers - or in all future browsers. The best way to make sure that your page looks the same in all browsers is to write your page using valid HTML and CSS, and then test it in as many browsers as possible. Clean, valid HTML is a good insurance policy, and using CSS separates presentation from content, and can help pages render and load faster. Validation tools, such as the HTML and CSS validators provided by the W3 Consortium, are useful for checking your site, and tools such as HTML Tidy can help you quickly and easily clean up your code. (Although we do recommend using valid HTML, it's not likely to be a factor in how Google crawls and indexes your site.)
Specify your character encoding
To help browsers render the text on your page, specify an encoding for your
document. Place the encoding at the top of the document (or frame), as some browsers won't
recognize charset declarations that appear deep in the document. In addition, make sure
that your web server is not sending conflicting HTTP headers. A header such as
content-type: text/html; charset=ISO-8859-1 will override any charset declarations
in your page.