May 29, 2012

How to make application browser compatible

Question by Rajesh

I am building an application which is working fine in IE8 and Mozilla Firefox,but not in IE7. I like firebug and I like to debug my application using that,but currently I am struggling with browser compatibility thing. I found that application developed is working in IE8,FF11 but not in IE7(mainly layout is highlighly impacted). I am using jquery for browser related functionality and the jquery thing seems to be working..what shall I do to make layout working fine in IE7?
Framework used is spring3,hibernate..
I have huge set of CSS I dont think pasting that here will be any helpful.I have used postion relative and used top,left position some things..padding and margin are used but not that much..is that the cause? what is the possible suggestion? why IE7 and IE8 render things in different way? Shall I load different set of CSS for IE7,using spring? is it good solution?if yes then how to do that in spring?
Shall i discard using firebug and rely on IE8 debugger because our client mainly use IE7

Answer by Starx

Browser compatibility is a very lengthy topic and it covers more than one area to perform correctly.

If IE 7 or IE browsers are your only problem, then CSS Conditional comments is the PERFECT solution for you.

Create a separate stylesheet, with all the neccessary fixes for IE7 browser. Then call the script is such a way, only IE 7 will render it.

<!--[if IE 7]>
    <link rel="stylesheet" type="text/css" media="screen" href="ie7fix.css" />
<![endif]-->

Now, the above stylesheet is only apply, in case if the browser is IE 7. So, all your fixes will be applied, thus the layout will be fixed. 🙂


To read more about conditional comments, read this article.

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!