What is the syntax if I want to upload a css file to my website using an if statement.
The situation is as follows:
If ie6 I load ie6_style.css
and if ie7, mozilla or new browsers, I will load style.css
<link rel="stylesheet" type="text/css" href="style.css"> <!--[if IE 6]> <link rel="stylesheet" type="text/css" href="ie6_style.css"> <![endif]-->
You will need to determine which browser is with javascript and then load the CSS.
Something like that
<script language="JavaScript"><!-- browser_version= parseInt(navigator.appVersion); browser_type = navigator.appName; if (browser_type == "Microsoft Internet Explorer" && (browser_version >= 7)) { document.write("<link REL='stylesheet' HREF='012899-ie7.css' TYPE='text/css'>"); } else if (browser_type == "Netscape" && (browser_version >= 5)) { document.write("<link REL='stylesheet' HREF='012899-netscape5.css' TYPE='text/css'>"); } // --></script>
Source: https://habr.com/ru/post/1727237/More articles:Creating equivalent classes in Python? - pythonAssembly versus binary output - assemblyentity structure several many many queries - c #Spring.NET & Immediacy CMS - c #Eclipse does not download the SDK for Android. - androidHow to force a WCF service channel to enter an erroneous state? - .netLua for configuration via XML / Yaml / INI in .NET? - .netCustomize console team culture - command-lineIn Java, which is the most recommended class for dictionary data structure? - javaGrid Cutting in Half-DirectX - directxAll Articles