<?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>Route to Success &#187; CSS Hacks</title>
	<atom:link href="http://www.crystalaxis.com/blog/category/css-hacks/feed" rel="self" type="application/rss+xml" />
	<link>http://www.crystalaxis.com/blog</link>
	<description></description>
	<lastBuildDate>Tue, 02 Feb 2010 04:28:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>CSS Hack for Safari and Google Chrome</title>
		<link>http://www.crystalaxis.com/blog/css-hack-for-safari-and-google-chrome</link>
		<comments>http://www.crystalaxis.com/blog/css-hack-for-safari-and-google-chrome#comments</comments>
		<pubDate>Sat, 14 Nov 2009 07:59:13 +0000</pubDate>
		<dc:creator>Asela de Saram</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS Hacks]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://www.crystalaxis.com/blog/?p=92</guid>
		<description><![CDATA[One day I was coding this site and found that the elements aligned perfectly except for this annoying 1px difference that appeared only in Safari and Google Chrome. So after many hours of Googling and lots of Coffee, I foung this online. This was my mis-behaving code: #rightmasthead, #leftmasthead { float:right; text-align: right; margin: 33px [...]]]></description>
			<content:encoded><![CDATA[<p>One day I was coding this site and found that the elements aligned perfectly except for this annoying 1px difference that appeared only in <a href="http://www.apple.com/safari/" target="_blank">Safari</a> and <a href="http://www.google.com/chrome/index.html?hl=en" target="_blank">Google Chrome</a>. So after many hours of Googling and lots of Coffee, I foung this online.</p>
<p>This was my mis-behaving code:</p>
<blockquote><p>
#rightmasthead, #leftmasthead {<br />
	float:right;<br />
	text-align: right;<br />
	margin: 33px 0;<br />
	padding: 10px 15px 0 0;<br />
	border:0px solid #000;<br />
	width: 300px;<br />
}
</p></blockquote>
<p>Personally, I try to avoid using CSS hacks, and when writing client code I always assume that anything can be done the &#8220;proper&#8221; way.</p>
<p>However, in most cases a hack is useful and needed, so here are two hacks (which are, in fact a valid CSS) that can be used to target and distinguish Google Chrome and Safari:</p>
<blockquote><p>
@media screen and (-webkit-min-device-pixel-ratio:0) {<br />
#rightmasthead, #leftmasthead {<br />
	margin: 32px 0; /* This works only in Safari and Google Chrome */<br />
}<br />
}
</p></blockquote>
<p>Viola it works now perfectly!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crystalaxis.com/blog/css-hack-for-safari-and-google-chrome/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
