|
|||||||
Join now to share free website templates or post on the forum. If you have never been on a forum before read the
FAQ. It's quick, easy and free to join!
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Good Day to all.
Here is a piece of code that my be helpfull to some. This code determines if your visitor is using IE or FF and others. At the same time it will determine which CSS file to attach to your pages. This way you can create 2 css files, one specific to IE only and other that works the best for FF and other browsers. I hope it will work for you. Code:
<script language="JavaScript">
<!--
browser_version= parseInt(navigator.appVersion);
browser_type = navigator.appName;
if (browser_type == "Microsoft Internet Explorer" && (browser_version >= 4)) {
document.write("<link rel='stylesheet' type='text/css' href='css/main_IE.css' />");
}
else {
document.write("<link REL='stylesheet' HREF='css/main.css' TYPE='text/css' />");
}
// --></script>
|
|
|||
|
HTML Code:
<script language="JavaScript"> <!-- browser_version= parseInt(navigator.appVersion); browser_type = navigator.appName; if (browser_type == "Microsoft Internet Explorer" && (browser_version >= 4)) { document.write("<link rel='stylesheet' type='text/css' href='css/main_IE.css' />"); } else if (browser_type == "Mozila firefox" && (browser_version >= 4)) { document.write("<link rel='stylesheet' type='text/css' href='css/main_mf.css' />"); } else { document.write("<link REL='stylesheet' HREF='css/main.css' TYPE='text/css' />"); } // --></script> . I am having troulbe with different look on IE and opera while look on firefox is good
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|