<?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>Web Development by Joe Sak &#187; Browsers</title>
	<atom:link href="http://www.joesak.com/category/browsers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.joesak.com</link>
	<description>Rails, HTML5, CSS3, jQuery - Thoughts, Advice &#38; Work</description>
	<lastBuildDate>Tue, 27 Jul 2010 14:10:14 +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>Fix your Javascript Print Style Switcher for Internet Explorer</title>
		<link>http://www.joesak.com/2007/02/19/fix-your-javascript-print-style-switcher-for-internet-explorer/</link>
		<comments>http://www.joesak.com/2007/02/19/fix-your-javascript-print-style-switcher-for-internet-explorer/#comments</comments>
		<pubDate>Mon, 19 Feb 2007 21:08:03 +0000</pubDate>
		<dc:creator>Joe Sak</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.joesak.com/design/fix-your-javascript-print-style-switcher-for-internet-explorer/</guid>
		<description><![CDATA[So you&#8217;ve decided to use javascript to swap out a print style css sheet that basically hides a bunch of divs and maybe widens the content area. Perhaps your re-color the links and the text and fix the font sizes. You try it in Firefox and it prints perfectly, but when you print in IE, [...]]]></description>
			<content:encoded><![CDATA[<p>So you&#8217;ve decided to use javascript to swap out a print style css sheet that basically hides a bunch of divs and maybe widens the content area. Perhaps your re-color the links and the text and fix the font sizes.</p>
<p>You try it in Firefox and it prints perfectly, but when you print in IE, you&#8217;ll notice IE didn&#8217;t really print your printable version.</p>
<p>So you think, &#8216;Ok I&#8217;ll add media=&#8221;print&#8221; to my stylesheet link!&#8217; and then you refresh your page, try your Print this Page link, and nothing happens! And it still prints the wrong version! What to do?</p>
<p>Well, your old pal Joe here figured it out.</p>
<p>Here&#8217;s what you do:</p>
<ol>
<li>Create a separate stylesheet called print.css</li>
<li>Add this code to your master stylesheet:<br />
<code><br />
@media print {</p>
<p>@import "print.css";</p>
<p>}<br />
</code></li>
<li>Implement your javascript for making the stylesheet override your master stylesheet</li>
<li>Test</li>
<li>Enjoy!</li>
</ol>
<p>This allows you to switch to your print style so it is preview-able before printing and also tells IE to use print.css when it prints a page on your site. So incidentally, if a user just clicks print in IE without switching to your style, they will still get your printable version. I suppose this might cause confusion but considering the most reasons for making hard copies of digital information, it probably shouldn&#8217;t pose too much of a problem for your average user.</p>
<p>Now if your user wants to have a pretty print out of your website because they can&#8217;t access a computer to show it to someone else away from home, they&#8217;ll probably get stuck with the fact that IE does not print background images and colors by default any way.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joesak.com/2007/02/19/fix-your-javascript-print-style-switcher-for-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CSS for IE 6 and 7 with no hacks</title>
		<link>http://www.joesak.com/2007/01/16/css-for-ie-with-no-hacks/</link>
		<comments>http://www.joesak.com/2007/01/16/css-for-ie-with-no-hacks/#comments</comments>
		<pubDate>Tue, 16 Jan 2007 05:22:04 +0000</pubDate>
		<dc:creator>Joe Sak</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.joesak.com/uncategorized/first-post/</guid>
		<description><![CDATA[UPDATE Since the time of this writing I have learned some important things: With correct doctypes, IE6 almost always renders the same as FFX and IE7, except when it comes to PNGs. If you set your body&#8217;s font-size to 62.5%, you reset browsers to 10px. Eric posted about this some time ago, but I really [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE</strong><br />
Since the time of this writing I have learned some important things:</p>
<ul>
<li>With correct doctypes, IE6 almost always renders the same as FFX and IE7, except when it comes to PNGs.</li>
<li>If you set your body&#8217;s font-size to 62.5%, you reset browsers to 10px.</li>
</ul>
<hr />
<p>Eric <a href="http://www.puidokas.com/updating-my-css-for-ie7/">posted about this</a> some time ago, but I really think this is one of the most unique methods I use in my coding process. I&#8217;ve yet to see this idea brought up by most sites I browse for CSS/XHTML solutions. The idea is that you can use pure XHTML in conjunction with <a href="http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp">conditional comments</a> to create a CSS style sheet that is free of your usual hacks. The reason we found this out is because the people on the IE 7 dev team actually managed to bring their new browser into closer range for compliant style rendering. IE 7, for the most part, follows the <a href="http://www.w3.org/TR/REC-CSS2/box.html">box model</a> pretty well, and ignores the usual string of hacks we use in our CSS.</p>
<p>Before we learned about conditional comments, we were using an underscore to rewrite any definitions that IE 6 needed to render our code correctly. The most common fix was usually to the width attribute. Add your padding back. Well, no more underscores. Here&#8217;s what you do:</p>
<p>When you create your body tag, write it as so:</p>
<p><code lang="xhtml"><!--[If lt IE 7]><br />
<body class="ie6"><br />
<![endif]--><br />
<!--[If IE 7]><br />
<body class="ie7"><br />
<![endif]--><br />
<!--<![If !IE]>--><br />
<body><br />
<!--<![endif]>--><br />
</code><br />
OK, so what is this mess, you wonder. This is code that only Internet Explorer since v5.5 understands. Microsoft did a good thing by adding this functionality so that web developers like us can fix our coding problems without hacks. Essentially here&#8217;s what it says in order from top to bottom:</p>
<p>If Less Than IE 7 then read: <code lang="xhtml"> <body class="ie6"> </code> If IE 7 then read: <code lang="xhtml"> <body class="ie7"> </code> If NOT IE, then read: <code lang="xhtml"> <body>  </code></p>
<p>Since the first two statements are commented out, all browsers except IE ignore the HTML inside the comments. The last statement is commented it out, as well, but the HTML:  is not. This is actually a twist on down-level revealed comments. The tags supplied by MS in the link above would have you use <code lang="xhtml"><![If !IE]></code>. This tag is not valid XHTML. All we did was put comments around it. IE still understands, and the code is perfectly valid. IE will skip that  tag, no other browser will. Everyone is happy.Here&#8217;s how you use it in CSS:One thing I noticed is font sizes in IE tend to be bigger than Firefox. Here&#8217;s what I usually do at the top of my CSS files:</p>
<p><code>body{<br />
font:normal 1em Arial, Helvetica, sans-serif; }<br />
body.ie6, body.ie7{<br />
font-size:0.9em;<br />
}<br />
</code></p>
<p>Starting my stylesheets with this declaration almost always guarantees my fonts will be the same size on Firefox, IE6, and IE7.</p>
<p>And of course, if you need to fix a width problem due to improper box model:</p>
<p><code> .bigdiv{<br />
width:140px;<br />
padding:0 5px;<br />
}<br />
body.ie6 .bigdiv{<br />
width:150px;<br />
} </code></p>
<p>Using body.ie6 as the parent selector will cause .bigdiv&#8217;s new width to only be implemented by IE 6.</p>
<p>You may read Eric&#8217;s post and notice he didn&#8217;t differentiate between IE 6 and 7 in his comments. Since his post, I&#8217;ve come to find that sometimes IE 6 needs fixing, sometimes IE 7 needs fixing, and sometimes they both do. That&#8217;s why I&#8217;ve chosen to differentiate between them in my body sub classes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joesak.com/2007/01/16/css-for-ie-with-no-hacks/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 6/16 queries in 0.008 seconds using disk

Served from: www.joesak.com @ 2010-09-09 21:39:49 -->