﻿<?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>Travis Miller &#187; safari</title>
	<atom:link href="http://www.electrumdigital.com/tag/safari/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.electrumdigital.com</link>
	<description>Web Developer for Hire</description>
	<lastBuildDate>Thu, 22 Jul 2010 14:17:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Conditional comments for iPhone</title>
		<link>http://www.electrumdigital.com/2009/10/conditional-comments-for-iphone/</link>
		<comments>http://www.electrumdigital.com/2009/10/conditional-comments-for-iphone/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 19:31:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Browser Issues]]></category>
		<category><![CDATA[XHTML & CSS]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://www.electrumdigital.com/?p=217</guid>
		<description><![CDATA[You're probably familiar with IE's conditional comments. They allow us to feed special code to that special browser to overcome its many bugs and deficiencies.
Is there something similar for iPhone? Not exactly, but we can achieve the same end:

&#60;!--[if !IE]&#62;&#60;!--&#62;
	&#60;link media=&#34;only screen and (max-device-width: 480px)&#34; href=&#34;iphone.css&#34; type=&#34;text/css&#34; rel=&#34;stylesheet&#34; /&#62;
&#60;!--&#60;![endif]--&#62;


Some versions of IE will apply stylesheets [...]]]></description>
			<content:encoded><![CDATA[<p>You're probably familiar with <acronym title="Internet Explorer">IE</acronym>'s <a href="http://www.quirksmode.org/css/condcom.html">conditional comments</a>. They allow us to feed special code to that special browser to overcome its many bugs and deficiencies.</p>
<p>Is there something similar for iPhone? Not exactly, but we can achieve the same end:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!--[if !IE]&gt;&lt;!--&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">media</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;only screen and (max-device-width: 480px)&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;iphone.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #808080; font-style: italic;">&lt;!--&lt;![endif]--&gt;</span></pre></div></div>

<p><span id="more-217"></span></p>
<p>Some versions of <acronym title="Internet Explorer">IE</acronym> will apply stylesheets regardless of the <code class="html">media</code> attribute, so the conditional comments are here merely to tell <acronym title="Internet Explorer">IE</acronym> <em>not</em> to use this code.</p>
<p>As for the value of the <code class="html">media</code> attribute: not all browsers understand the "only" keyword; they will simply ignore this line. Of those that <em>do</em> understand it, the only one width a max-device-width of 480px is the iPhone.</p>
<p>(So I'm told. I'm taking all of this on faith. But it seems to work.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electrumdigital.com/2009/10/conditional-comments-for-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
