Forums / Cotonti / Support / Different CSS

different CSS for each browser

5uper Mario
#1 2009-08-24 10:36
yo

Some of you may know I am in the progress of making a new skin.

Well, its displaying as I want it too in Firefox.
BUT in IE....

Yea in IE its kinda messed up.
Links out of place ect....

I wanted to know if its possible to load different CSS depending on the browser.
eg. If on IE load up IE.css
while the default css file it loaded for all the other browsers
like Firefox

I have this in the head.tpl file:

<!-- BEGIN: HEADER -->
{HEADER_DOCTYPE}
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="content-type" content="{HEADER_META_CONTENTTYPE}; charset={HEADER_META_CHARSET}" />
<meta name="description" content="{HEADER_META_DESCRIPTION}" />
<meta name="keywords" content="{HEADER_META_KEYWORDS}" />
<meta name="generator" content="Cotonti http://www.cotonti.com" />
<meta http-equiv="expires" content="Fri, Apr 01 1974 00:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="last-modified" content="{HEADER_META_LASTMODIFIED} GMT" />
{HEADER_HEAD}
{HEADER_BASEHREF}
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="http://98.228.103.157/forum/skins/war/IE8.css" />
<![endif]-->

<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="http://98.228.103.157/forum/skins/war/IE7.css" />
<![endif]-->

<link rel="shortcut icon" href="favicon.ico" />
<link href="skins/{PHP.skin}/{PHP.theme}.css" type="text/css" rel="stylesheet" />
{HEADER_COMPOPUP}
<title>{HEADER_TITLE}</title>
</head>

Got that from a site
Said it would work
Too bad it doesn't


Am sure this has been asked before
and I'm sure this is a easy fix

Just wanna know

Thanks.
GHengeveld
#2 2009-08-24 16:03
if/endif doesnt work that way as far as i know. You can use those tags only inside a <style> element. @import might work but its not supported in all browsers. You should google 'browser specific css'.
A final note: you dont need to specify the entire url (http...) if you have set basehref.