<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WebDesign &#38; Such &#187; Conditional Statements</title>
	<atom:link href="http://webdesignandsuch.com/tag/conditional-statements/feed/" rel="self" type="application/rss+xml" />
	<link>http://webdesignandsuch.com</link>
	<description>a Beantown Design Production</description>
	<lastBuildDate>Wed, 08 Sep 2010 02:29:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Internet Explorer Conditional Statements &amp; Hacks</title>
		<link>http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements/</link>
		<comments>http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 21:02:28 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Conditional Statements]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=279</guid>
		<description><![CDATA[As a website designer, one of the challenges we have is making websites that look and function the same in a variety of browsers. In a perfect world everybody would use the latest version of the same browser. Then we would only need to design websites for this one browser. Unfortunately this is not the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-292" title="ie" src="http://webdesignandsuch.com/wp-content/uploads/2009/07/ie2.jpg" alt="ie" width="459" height="328" class="frame"/></p>
<p>As a website designer, one of the challenges we have  is making websites that look and function the same in a variety of browsers. In a perfect world everybody would use the latest version of the same browser. Then we would only need to design websites for this one browser. Unfortunately this is not the case.</p>
<p>Perhaps people are scared of updating their browser, or don&#8217;t even know why they should. Newer browsers have better security, and support the latest technologies we use as website designers / developers.</p>
<p>One of the largest challenges is dealing with the Internet Explorer browser. This browser is one of the most commonly used browsers, but always seems to make problems. I&#8217;m not going to go into the different issues IE creates, I&#8217;ll assume you know. The point of this article is to show the different ways of targeting Internet Explorer browsers with your XHTML / CSS. There are many different techniques, I&#8217;m going to show the ones I use most commonly.<span id="more-279"></span></p>
<h1 style="margin-top:20px"><em>Conditional Statements</em></h1>
<h3>Import a CSS style sheet if the users browser is IE</h3>
<div  class="codeBox"><code>&lt;!--[if IE]&gt; </code><span><br />
&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;styles/ie.css&#8221; type=&#8221;text/css&#8221; /&gt;</span><code><br />
&lt;![endif]--&gt;</code></div>
<h3>Import a CSS style sheet if the users browser is IE6</h3>
<div class="codeBox"><code>&lt;!--[if IE 6]&gt; </code><span><br />
&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;styles/ie6.css&#8221; type=&#8221;text/css&#8221; /&gt;</span><code><br />
&lt;![endif]--&gt;</code></div>
<h3>Import a CSS style sheet if the users browser is IE7</h3>
<div class="codeBox"><code>&lt;!--[if IE 7]&gt; </code><span><br />
&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;styles/ie7.css&#8221; type=&#8221;text/css&#8221; /&gt;</span><code><br />
&lt;![endif]--&gt;</code></div>
<h3>Import a CSS style sheet if the users browser is a version of IE before 7</h3>
<div class="codeBox"><code>&lt;!--[if lt IE 7]&gt;<br />
</code><span>&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;styles/ie.css&#8221; type=&#8221;text/css&#8221; /&gt;</span><code><br />
&lt;![endif]--&gt;</code></div>
<h1 style="margin-top:20px"><em>CSS Hacks</em></h1>
<h3>Target IE with your CSS ( use star * )</h3>
<div class="codeBox"><code>#column {margin-left:20px; *margin-left:10px}</code></div>
<h3>Target IE6 with your CSS ( use underscore _ )</h3>
<div class="codeBox"><code>#column {margin-left:20px; _margin-left:10px}</code></div>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements-2/" rel="bookmark" class="crp_title">Internet Explorer Conditional Statements &amp; Hacks</a></li><li><a href="http://webdesignandsuch.com/2009/07/how-to-add-the-current-date-to-your-webpage-with-javascipt/" rel="bookmark" class="crp_title">How to Add the Current Date to your webpage with Javascipt</a></li><li><a href="http://webdesignandsuch.com/2009/07/how-to-add-the-current-date-to-your-webpage-with-javascipt-2/" rel="bookmark" class="crp_title">Add Current Date to webpage with Javascipt</a></li><li><a href="http://webdesignandsuch.com/2009/12/how-to-create-a-custom-iphone-icon-for-your-website/" rel="bookmark" class="crp_title">How to create a custom iPhone icon for your website</a></li><li><a href="http://webdesignandsuch.com/2009/10/rounded-corners-with-css3-border-radius/" rel="bookmark" class="crp_title">Rounded corners with CSS3 ~ border-radius</a></li></ul></div>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements/&amp;title=Internet+Explorer+Conditional+Statements+%26+Hacks" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements/&amp;title=Internet+Explorer+Conditional+Statements+%26+Hacks" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements/&amp;bm_description=Internet+Explorer+Conditional+Statements+%26+Hacks&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements/&amp;title=Internet+Explorer+Conditional+Statements+%26+Hacks" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements/&amp;title=Internet+Explorer+Conditional+Statements+%26+Hacks" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements/&amp;title=Internet+Explorer+Conditional+Statements+%26+Hacks" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Internet+Explorer+Conditional+Statements+%26+Hacks+-+http://b2l.me/ap7auq&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internet Explorer Conditional Statements &amp; Hacks</title>
		<link>http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements-2/</link>
		<comments>http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements-2/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 21:02:28 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Conditional Statements]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=279</guid>
		<description><![CDATA[As a website designer, one of the challenges we have is making websites that look and function the same in a variety of browsers. In a perfect world everybody would use the latest version of the same browser. Then we would only need to design websites for this one browser. Unfortunately this is not the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-292" title="ie" src="http://webdesignandsuch.com/wp-content/uploads/2009/07/ie2.jpg" alt="ie" width="459" height="328" /></p>
<p>As a website designer, one of the challenges we have  is making websites that look and function the same in a variety of browsers. In a perfect world everybody would use the latest version of the same browser. Then we would only need to design websites for this one browser. Unfortunately this is not the case.</p>
<p>Perhaps people are scared of updating their browser, or don&#8217;t even know why they should. Newer browsers have better security, and support the latest technologies we use as website designers / developers.</p>
<p>One of the largest challenges is dealing with the Internet Explorer browser. This browser is one of the most commonly used browsers, but always seems to make problems. I&#8217;m not going to go into the different issues IE creates, I&#8217;ll assume you know. The point of this article is to show the different ways of targeting Internet Explorer browsers with your XHTML / CSS. There are many different techniques, I&#8217;m going to show the ones I use most commonly.<span id="more-1018"></span></p>
<h1 style="margin-top: 20px;"><em>Conditional Statements</em></h1>
<h3>Import a CSS style sheet if the users browser is IE</h3>
<div class="codeBox"><code>&lt;!--[if IE]&gt; </code><span><br />
&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;styles/ie.css&#8221; type=&#8221;text/css&#8221; /&gt;</span><code><br />
&lt;![endif]--&gt;</code></div>
<h3>Import a CSS style sheet if the users browser is IE6</h3>
<div class="codeBox"><code>&lt;!--[if IE 6]&gt; </code><span><br />
&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;styles/ie6.css&#8221; type=&#8221;text/css&#8221; /&gt;</span><code><br />
&lt;![endif]--&gt;</code></div>
<h3>Import a CSS style sheet if the users browser is IE7</h3>
<div class="codeBox"><code>&lt;!--[if IE 7]&gt; </code><span><br />
&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;styles/ie7.css&#8221; type=&#8221;text/css&#8221; /&gt;</span><code><br />
&lt;![endif]--&gt;</code></div>
<h3>Import a CSS style sheet if the users browser is a version of IE before 7</h3>
<div class="codeBox"><code>&lt;!--[if lt IE 7]&gt;<br />
</code><span>&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;styles/ie.css&#8221; type=&#8221;text/css&#8221; /&gt;</span><code><br />
&lt;![endif]--&gt;</code></div>
<h1 style="margin-top: 20px;"><em>CSS Hacks</em></h1>
<h3>Target IE with your CSS ( use star * )</h3>
<div class="codeBox"><code>#column {margin-left:20px; *margin-left:10px}</code></div>
<h3>Target IE6 with your CSS ( use underscore _ )</h3>
<div class="codeBox"><code>#column {margin-left:20px; _margin-left:10px}</code></div>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements/" rel="bookmark" class="crp_title">Internet Explorer Conditional Statements &#038; Hacks</a></li><li><a href="http://webdesignandsuch.com/2009/07/how-to-add-the-current-date-to-your-webpage-with-javascipt-2/" rel="bookmark" class="crp_title">Add Current Date to webpage with Javascipt</a></li><li><a href="http://webdesignandsuch.com/2009/07/how-to-add-the-current-date-to-your-webpage-with-javascipt/" rel="bookmark" class="crp_title">How to Add the Current Date to your webpage with Javascipt</a></li><li><a href="http://webdesignandsuch.com/2009/12/how-to-create-a-custom-iphone-icon-for-your-website/" rel="bookmark" class="crp_title">How to create a custom iPhone icon for your website</a></li><li><a href="http://webdesignandsuch.com/2009/10/rounded-corners-with-css3-border-radius/" rel="bookmark" class="crp_title">Rounded corners with CSS3 ~ border-radius</a></li></ul></div>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements-2/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements-2/&amp;title=Internet+Explorer+Conditional+Statements+%26amp%3B+Hacks" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements-2/&amp;title=Internet+Explorer+Conditional+Statements+%26amp%3B+Hacks" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements-2/&amp;bm_description=Internet+Explorer+Conditional+Statements+%26amp%3B+Hacks&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements-2/&amp;title=Internet+Explorer+Conditional+Statements+%26amp%3B+Hacks" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements-2/&amp;title=Internet+Explorer+Conditional+Statements+%26amp%3B+Hacks" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements-2/&amp;title=Internet+Explorer+Conditional+Statements+%26amp%3B+Hacks" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements-2/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Internet+Explorer+Conditional+Statements+%26amp%3B+Hacks+-+http://b2l.me/ap7aur&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2009/07/internet-explorer-hacks-and-conditional-statements-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
