Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Where to put conditional comment?
Old 02-23-2009, 04:01 AM Where to put conditional comment?
Novice Talker

Posts: 13
Trades: 0
I want my site to refrence to a different CSS file with IE.

Is this the correct format for the conditional comment code and if so, where exactly do I put it in my html code?

<!--[if IE]>
<link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]-->


HTML CODE:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Concept Communications</title>
<style type="text/css" media="all">
<!--
@import url("styles.css");
-->

<style type="text/css">
.class2 {
display:block;
}
</style>
<script language="javascript">
function changeback()
{
document.getElementById('featureWrapper').classNam e = 'class3';
}
</script>
<style type="text/css">
.class3 {
display:none;
}
.style1 { font-size: 120%;
font-style: italic;
font-weight: bold;
}
.style2 {
color: #FFF;
}
.style3 {color: #333333}
.style6 {font-size: 16px}
.style8 {font-size: 26px}
</style>
</head>
<body>


<div id="headerWrapper">
<div id="header">
<div id="logo"><a href="#"><img src="images/logo.png" alt="" width="363" height="118" class="png" /></a></div>
<div id="tagline"><a href="http://www.concept.bz/DVR/">Customer DVR Login</a></div>
<div id="nav">
<ul>
<li id="active"><a href="http://www.concept.bz">Home</a></li>
<li><a href="http://www.concept.bz/About/index.html">About</a></li>
<li><a href="http://www.concept.bz/Products/index.html">Products</a></li>
<li><a href="http://www.concept.bz/Support/index.html">Support</a></li>
<li><a href="http://www.concept.bz/Contact/index.html">Contact</a></li>
</ul>
</div>
</div>
</div>
<div id="featureWrapper" class="class2">
<div id="feature"><a href="http://www.concept.bz/Catalog/"><img src="images/home-featured.gif" alt="" width="418" height="233" usemap="#Map" class="clearFloat" style="float: right;"/></a>
<map name="Map" id="Map">
<area shape="rect" coords="425,163,533,240" href="http://www.justdreamweaver.com/features/siteassist.html" target="_blank" alt="Site Assist Professional" />
</map>
<p class="feature-title style8">State of the Art Communication and </p>
<p class="feature-title style8"> Surveillance Systems </p>
<p class="feature-text style3"> For Large Industry, Small Business<span class="style6">, or Office</span> </p>
<ul>
<li> Quick Service Industry Systems </li>
<li>DVR and Video Surveillance </li>
<li>Commercial Free Music and Personalized Messaging </li>
<li>Telecommunication and DSL system installation</li>
</ul>
</div>
</div>
<div id="outerWrapper">
<div id="contentWrapper">
<div id="leftColumn1">
<div>
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" width="195" height="400" class="clearFloat" id="myFlashContent">
<param name="movie" value="Flash.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="Flash.swf" width="195" height="400">
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</div>

<div id="content">
<h1><strong>Concept Communications Offers You Everything You Need To Keep

Your Business Running Smoothly </strong></h1>
<p><span class="style1">Quick Service industry we offer:</span></p>
<ul>
<li>
Drive-thru headset system installations and service</li>
<li>Commercial free music and messaging</li>
<li>Telecommunication and DSL system installation</li>
<li>DVR's Digital Surveillance System</li>
<li>Order Conformation systems integration </li>
<li>Satellite TV, flat screen installations <br />
</li>
</ul>
<p><span class="style1">Offices, Churches, Small Office Environments:</span></p>
<ul>
<li>Commercial free music with personalized optional messaging</li>
<li>Telecommunication and DSL system installation</li>
<li>DVR's Digital Surveillance Systems</li>
<li>Room control and automation <br />
</li>
</ul>
<blockquote><blockquote><blockquote><blockquote><b lockquote><blockquote><blockquote><blockquote><blo ckquote>&nbsp;</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<h2>&nbsp;</h2>
<p><center><a href="http://www.whatsmyip.us"><img src="http://www.whatsmyip.us/ipimg2.php" alt="my ip" border="0" align="absmiddle" /></a></center>
</p>
</div>
</div>
<div id="footer">
<div class="style2" style="float: left;">Copyright © 2009 Concept Communications </div>
<div style="float: right; text-align: right;"><a href="http://www.concept.bz">Home</a> | <a href="http://www.concept.bz/Support/index.html">Support</a> |<a href="http://www.concept.bz/Contact/index.html"> Contact</a></div>
<div align="center"></div>
</div>
</div>
<script type="text/javascript">
<!--
swfobject.registerObject("FlashID");
//-->
</script>
</body>
</html>
corywiley is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-23-2009, 05:58 PM Re: Where to put conditional comment?
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Quote:
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]-->
Yes, that's correct, and it goes in the <head> section.
However, you really should use a more specific if statement if all you're targeting is IE6. I use this:
Quote:
<!--[if lt IE 7]>
<link href="iefixes.css" rel="stylesheet" type="text/css" /> <![endif]-->
That targets any version of IE below 7. Since IE7 has it's own problems, I use this for IE7:
Quote:
<!--[if gt IE 6]>
<link href="ie7fixes.css" rel="stylesheet" type="text/css" /> <![endif]-->
I'll have to change that once IE8 is released.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 02-24-2009, 12:44 AM Re: Where to put conditional comment?
Novice Talker

Posts: 13
Trades: 0
I have tried putting it in the <head> section many times with no success. If I place it before the

<!--
@import url("styles.css");
-->

the conditional comment is all grey, if I place it after, half the text is pink. Which is correct? Niether ways seem to work correctly
corywiley is offline
Reply With Quote
View Public Profile
 
Old 02-24-2009, 12:52 AM Re: Where to put conditional comment?
Novice Talker

Posts: 13
Trades: 0
Edited, see below

Last edited by corywiley; 02-24-2009 at 01:40 AM..
corywiley is offline
Reply With Quote
View Public Profile
 
Old 02-24-2009, 01:38 AM Re: Where to put conditional comment?
Novice Talker

Posts: 13
Trades: 0
Here is my code now, it still isnt refrencing to the other ie.css sheet. Is the <!--[IE}> Codes near the bottom for the flash overriding it some how? Anyone see a reason why it wouldnt be working?

Site: test.concept.bz






<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<!--[if lt IE 7]>
<link href="ie.css" rel="stylesheet" type="text/css" /> <![endif]-->

<LINK href="styles.css" rel="stylesheet" type="text/css">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Concept Communications</title>

<style type="text/css" media="all">
.style1 { font-size: 120%;
font-style: italic;
font-weight: bold;
}
.style2 {
color: #FFF;
}
.style3 {color: #333333}
.style6 {font-size: 16px}
.style8 {font-size: 26px}
</style>
</head>
<body>


<div id="headerWrapper">
<div id="header">
<div id="logo"><a href="#"><img src="images/logo.png" alt="" width="363" height="118" class="png" /></a></div>
<div id="tagline"><a href="http://www.concept.bz/DVR/">Customer DVR Login</a></div>
<div id="nav">
<ul>
<li id="active"><a href="http://www.concept.bz">Home</a></li>
<li><a href="http://www.concept.bz/About/index.html">About</a></li>
<li><a href="http://www.concept.bz/Products/index.html">Products</a></li>
<li><a href="http://www.concept.bz/Support/index.html">Support</a></li>
<li><a href="http://www.concept.bz/Contact/index.html">Contact</a></li>
</ul>
</div>
</div>
</div>
<div id="featureWrapper" class="class2">
<div id="feature"><a href="http://www.concept.bz/Catalog/"><img src="images/home-featured.gif" alt="" width="418" height="233" usemap="#Map" class="clearFloat" style="float: right;"/></a>
<map name="Map" id="Map">
<area shape="rect" coords="425,163,533,240" href="http://www.justdreamweaver.com/features/siteassist.html" target="_blank" alt="Site Assist Professional" />
</map>
<p class="feature-title style8">State of the Art Communication and </p>
<p class="feature-title style8"> Surveillance Systems </p>
<p class="feature-text style3"> For Large Industry, Small Business<span class="style6">, or Office</span> </p>
<ul>
<li> Quick Service Industry Systems </li>
<li>DVR and Video Surveillance </li>
<li>Commercial Free Music and Personalized Messaging </li>
<li>Telecommunication and DSL system installation</li>
</ul>
</div>
</div>
<div id="outerWrapper">
<div id="contentWrapper">
<div id="leftColumn1">
<div>
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" width="195" height="400" class="clearFloat" id="myFlashContent">
<param name="movie" value="Flash.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="Flash.swf" width="195" height="400">
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</div>

<div id="content">
<h1><strong>Concept Communications Offers You Everything You Need To Keep

Your Business Running Smoothly </strong></h1>
<p><span class="style1">Quick Service industry we offer:</span></p>
<ul>
<li>
Drive-thru headset system installations and service</li>
<li>Commercial free music and messaging</li>
<li>Telecommunication and DSL system installation</li>
<li>DVR's Digital Surveillance System</li>
<li>Order Conformation systems integration </li>
<li>Satellite TV, flat screen installations <br />
</li>
</ul>
<p><span class="style1">Offices, Churches, Small Office Environments:</span></p>
<ul>
<li>Commercial free music with personalized optional messaging</li>
<li>Telecommunication and DSL system installation</li>
<li>DVR's Digital Surveillance Systems</li>
<li>Room control and automation <br />
</li>
</ul>
<blockquote><blockquote><blockquote><blockquote><b lockquote><blockquote><blockquote><blockquote><blo ckquote>&nbsp;</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<h2>&nbsp;</h2>
<p><center><a href="http://www.whatsmyip.us"><img src="http://www.whatsmyip.us/ipimg2.php" alt="my ip" border="0" align="absmiddle" /></a></center>
</p>
</div>
</div>
<div id="footer">
<div class="style2" style="float: left;">Copyright © 2009 Concept Communications </div>
<div style="float: right; text-align: right;"><a href="http://www.concept.bz">Home</a> | <a href="http://www.concept.bz/Support/index.html">Support</a> |<a href="http://www.concept.bz/Contact/index.html"> Contact</a></div>
<div align="center"></div>
</div>
</div>
<script type="text/javascript">
<!--
swfobject.registerObject("FlashID");
//-->
</script>
</body>
</html>
corywiley is offline
Reply With Quote
View Public Profile
 
Old 02-24-2009, 07:12 PM Re: Where to put conditional comment?
serandfae's Avatar
Do the "Evil Nanner" !!!

Posts: 8,936
Name: Tim Daily
Location: Apex, NC, US, Sol 3
Trades: 0
You have to put conditional comments in the head, but AFTER the normal CSS for your page. What IE then does is read the normal stylesheet, then the conditional comments, which override whatever you've specifically targeted for IE.

tim
__________________
SEO "experts" smell like Big Fish_|_
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Last edited by serandfae; 02-24-2009 at 07:14 PM..
serandfae is offline
Reply With Quote
View Public Profile Visit serandfae's homepage!
 
Reply     « Reply to Where to put conditional comment?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.28253 seconds with 12 queries