views:

142

answers:

2

I use -moz-border-radius and -webkit-border-radius for making rounded corner. However as we know IE 7 doesn't support that. What I would like to do is to basically use standard for firefox and Safari however for IE I would like to use javascript. by using this http://www.editsite.net/blog/rounded%5Fcorners.html

My question is how can i make conditional so that each browser know the way to render the page?

+2  A: 

Use conditional comments to include a <script> for MSIE only.

nlogax
+1  A: 

Just leave the -moz-border-radius and -webkit-border-radius rules in your CSS, IE will completely ignore them. You can place the javascript for IE using conditional comments like so:

<!--[if IE]>
    <script type="text/javascript">
        Rounded('rounded', 6, 6);
    </script>
<![endif]-->

All browsers other than IE will completely ignore this. If you want this only for a specific version of IE, use this instead:

<!--[if IE 7]>
    <script type="text/javascript">
        Rounded('rounded', 6, 6);
    </script>
<![endif]-->
Siddhartha Reddy