Browser sniffing or detection : Conditional Css
<!--[if gt IE 6]>
<link rel="stylesheet" type="text/css" href="css/ie7fix.css" media="screen" />
<![endif]-->
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="css/ie6fix.css" media="screen" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="css/ie7fix.css" media="screen" />
<![endif]-->
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="css/ie6fix.css" media="screen" />
<![endif]-->
var useragent = navigator.userAgent;
var bName = (useragent.indexOf('Firefox') > -1) ? 'Firefox' :
navigator.appName;
if (bName == "Firefox")
{
document.writeln('<style> #nav_bar_t6 {padding-left:33px;
padding-right:33px; } #footer {margin-left:18%}</style>');
}
if(navigator.userAgent.indexOf ("Netscape")!=-1)
{
document.writeln('<style> #nav_bar_t4 {WIDTH:
14.2%;padding-left:2px;} #footer {margin-left:18%}</style>');
}
if(navigator.userAgent.indexOf ("Opera")!=-1)
{
document.writeln('<style> #nav_bar_t6 {padding-left:38px;
padding-right:33px;} #footer {margin-left:18%}</style>');
}
</script>
Comments
Post a Comment
Thanks
Warm regards,
Karthikeyan.T
tkarthikeyan@gmail.com
www.carthworks.com
Call us 09445 2772 06