Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ensure that the code works across multiple browsers?

Tags:

html

css

What would be the process for ensuring that the code works as expected across multiple browsers. What would be the best answer?

like image 225
dragonfly Avatar asked Mar 22 '11 17:03

dragonfly


2 Answers

  • Be XHTML compliant (w3.org validator)
  • Be CSS compliant (w3.org validator)
  • Use a JavaScript library that is cross-browser compatible (less direct call to JavaScript as possible)

Test, test, test during development. Not at the end!

like image 121
Mike Gleason jr Couturier Avatar answered Nov 15 '22 01:11

Mike Gleason jr Couturier


Avoid bleeding edge code.

Yeah, I know, many of you will hate that answer. And if you've never worked in a large enterprise environment, you'll think I'm a Luddite. However, I can't tell you how many times the requirements I've been given have specifically listed "No HTML5" or "No CSS3" elements simply because the client was paranoid about IE6 working exactly as the others did.

The obvious overall answer is testing, but I'd go one step further. If you're worried about 100% operation in all browsers, you have to define your standards. For example, if you have to code back to IE6, do you have to worry about mimicking rounded corners, which is always a hack on IE6 and below? Or, will the client accept progressive enhancement such as square corners for those on browers from the dark ages and rounded for the rest of us? Does the client specify fonts that can't be told apart when pulling the page up side-by-side, or do they understand that browsers use different font rendering engines? Is it ok to work just in IE6, or do you have to also support quirks mode? What about rendering with a screen reader (accessibility) or without CSS or Javascript. How about mobile devices? All these were valid and measurable issues with my last major corporate client.

I like Adobe's Browser Labs as my first line of defense for testing. However, it's just one of many steps I take including multiple physical computers on multiple OS's connecting via multiple connections through different network proxies. You just can't test enough....and even then expect to find an error as the site is launched and matures.

like image 42
bpeterson76 Avatar answered Nov 14 '22 23:11

bpeterson76