I have just recently been getting into the web development scene and I have discovered that just because code works in one browser does not mean it will work in another. I have noticed that my code seems to render just fine in chrome, opera and firefox but somehow IE consistently has problems. Inquisitive research suggested that this is because IE does not follow web standards that the w3c has set forth upon the development community. So my question is this: Is it possible to develop code that works well with <b>all</b> browsers? Or maybe there is a way to specify code specifically for IE and have all other browsers ignore said snippets?

It is quite frustrating as you all know to have an awesome web layout only to find it practically destroyed by the likes of Internet Explorer.

Thank you to those who can shed some light on this subject.

-scandalist

First of all, think of which versions of IE you want to support; IE6 and IE8 are a whole different story.
Second, all the different quirks in IE are quite well documented, along with workarounds. You might want to look them up.
Third, as for javascript (I know that's not really your question but IMHO javascript in IE6 is a bigger problem than IE6's layout engine) using a library might help you. Not to say that you should always use a library (and certainly don't start jQuery-ing without having started with JS) but it might as well make your life easier :)
As a last resort, there are conditional comments.

I have noticed that my code seems to render just fine in chrome, opera and firefox but somehow IE consistently has problems.

Yes, CSS varies on different browsers so the rendering may also vary.

Inquisitive research suggested that this is because IE does not follow web standards that the w3c has set forth upon the development community.

Fortunately, the new IE9 has the compatibility feature to support web applications built for older browsers.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.