<?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>Chris JeanChris Jean &#187; Browser Wars</title>
	<atom:link href="http://chrisjean.com/tag/browser-wars/feed/" rel="self" type="application/rss+xml" />
	<link>http://chrisjean.com</link>
	<description>Linux, WordPress, programming, anime, and other stuff</description>
	<lastBuildDate>Mon, 16 Jan 2012 15:22:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Fix width:auto Floated Elements in IE 6</title>
		<link>http://chrisjean.com/2009/09/30/fix-width-auto-floated-elements-in-ie-6/</link>
		<comments>http://chrisjean.com/2009/09/30/fix-width-auto-floated-elements-in-ie-6/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 05:37:53 +0000</pubDate>
		<dc:creator>Chris Jean</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>
		<category><![CDATA[Browser Wars]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Internet Explorer 6]]></category>

		<guid isPermaLink="false">http://gaarai.com/?p=1604</guid>
		<description><![CDATA[It is popular to use ul and li elements float them and set them to width:auto in CSS in order to create a horizontal list of self-sizing boxes. These can easily be used to create horizontal navigation or a listing of tabs, and it works very well. However, there is one caveat; given the right [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>It is popular to use <code>ul</code> and <code>li</code> elements float them and set them to <code>width:auto</code> in CSS in order to create a horizontal list of self-sizing boxes. These can easily be used to create horizontal navigation or a listing of tabs, and it works very well. However, there is one caveat; given the right mix of CSS this solution doesn&#8217;t work properly in IE 6.</p>
<p>To create this scenario, we can simply use something like the following:</p>
<pre>&lt;style type="text/css"&gt;
    ul {
        height: 30px;
        overflow: hidden;
    }
    ul li {
        float: left;
        width: auto;
    }
    ul li a {
        display: block;
        height: 30px;
    }
&lt;/style&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="#"&gt;Link 1&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;Link 2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</pre>
<p>This will show the problem in IE 6 nicely. The problem is that IE 6 interprets this mix of CSS and decides that each <code>li</code> element should actually expand out to 100% width.</p>
<p>I&#8217;ll explain how to fix this issue and provide and example page so you can easily play around with the HTML and CSS yourself.</p>
<p><span id="more-1604"></span></p>
<h3>Fix #1</h3>
<p>A quick way to tame the IE 6 beast is to give the offending element a width of 0. Counter to intuition, this won&#8217;t force the element to an infinitely-small width; rather, it will force IE 6 to automatically-size the width of the element. However, this has an immediate problem, all other browsers will see this width of 0 for what it really is and render nothing for that element since, well, it has a width of 0.</p>
<p>There are a few different ways to correct this:</p>
<ol>
<li>We can use a hack to introduce the width 0 command to IE 6 without having the other browsers take notice. This works and can be implemented by using <code>_width:0</code> to specifically target IE 6. For example:
<pre>#nav ul li {
    width: auto;
    _width: 0;
    float: left;
}</pre>
</li>
<li>Since using a hack isn&#8217;t always preferable, another option is to selectively-load a CSS document that adds the IE 6-only behavior. In the HTML document, you first load the standard stylesheet followed by the IE 6-specific stylesheet:
<pre>&lt;link rel="stylesheet" href="/css/style.css" type="text/css" media="screen" /&gt;
&lt;!--[if lt IE 7]&gt;
    &lt;link rel="stylesheet" href="/css/lt-ie7.css" type="text/css" media="screen" /&gt;
&lt;![endif]--&gt;</pre>
<p>In the IE 6 stylesheet, add the <code>width:0</code> style:</p>
<pre>#nav ul li {
    width: 0;
}</pre>
</li>
<li>We can use CSS selectors that are ignored by IE 6. This doesn&#8217;t use a hack and also avoids using a separate stylesheet.
<pre>#nav ul li {
    width: 0;
    float: left;
}
#nav ul &gt; li {
    width: auto;
}</pre>
</li>
</ol>
<p>Each of these methods work nicely, however, after some additional testing, a new limitation becomes clear. For some reason, IE 6 now decides that only one word should be permitted in each box. Basically, it seems to word-wrap all additional words, effectively cutting them off. Thus the need for another fix.</p>
<h3>Fix #2</h3>
<p>The solution to preventing IE 6 from truncating each element is simple: prevent word wrapping. This is easily done using the <code>white-space:nowrap</code> CSS instruction.</p>
<p>Using the third example above, we can change it to the following to apply this next fix:</p>
<pre>#nav ul li {
    width: 0;
    float: left;
    white-space: nowrap;
}
#nav ul &gt; li {
    width: auto;
}</pre>
<h3>Example Page</h3>
<p>I built an <a href="http://www.gaarai.com/ie6-auto-width-float-fix.html" target="_blank">example page</a> that shows what is actually occurring during each step of this process and shows how each fix improves the rendering in IE 6. The final example renders as it should.</p>
<p>Here is a screenshot that shows how it renders in IE 6:</p>
<div id="attachment_1611" class='wp-caption alignnone' style='width:515px;'><a href="http://www.gaarai.com/ie6-auto-width-float-fix.html" target="_blank"><img class="size-full wp-image-1611 " title="ie-6-nav-issue" src="http://chrisjean.com/wp-content/uploads/2009/09/ie-6-nav-issue.png" alt="ie-6-nav-issue" width="515" height="541" /></a><p class='wp-caption-text'>Example Rendering in IE 6</p></div>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2009/09/30/fix-width-auto-floated-elements-in-ie-6/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Vertically Centering HTML Content via CSS</title>
		<link>http://chrisjean.com/2009/09/27/vertically-centering-html-content-via-css/</link>
		<comments>http://chrisjean.com/2009/09/27/vertically-centering-html-content-via-css/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 05:00:13 +0000</pubDate>
		<dc:creator>Chris Jean</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>
		<category><![CDATA[Browser Wars]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://gaarai.com/?p=1586</guid>
		<description><![CDATA[Today I  have yet another entry on HTML and CSS. Today it is how to vertically center content in HTML using CSS. You&#8217;d think that there would be a standard definition of how to vertically center any content by now, but there isn&#8217;t. There are a variety of methods out there that do this. I [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>Today I  have yet another entry on HTML and CSS. Today it is how to vertically center content in HTML using CSS.</p>
<p>You&#8217;d think that there would be a standard definition of how to vertically center any content by now, but there isn&#8217;t. There are a variety of methods out there that do this. I frequently see people using the line-height CSS property to vertically center content. While this appears to work, it isn&#8217;t very flexible, only works properly if there is only one line of text, and doesn&#8217;t work in all situations.</p>
<p>I found <a href="http://www.jakpsatweb.cz/css/css-vertical-center-solution.html" target="_blank">Yuhu&#8217;s Definitive Solution with Unknown Height</a> which looks great, works properly with all major browsers, doesn&#8217;t have the limitations I&#8217;ve seen in other solutions, and is quite simple to implement. Basically all you have to do is have three divs wrapped around the content you wish to vertically center and use specific styling for those divs.</p>
<p>The following code is what does the magic. Replace the comment with the content to be vertically centered, change the height to match the vertical height of the container, and you&#8217;re set.</p>
<pre>&lt;div style="display:table; height:400px; #position:relative;"&gt;
    &lt;div style="#position:absolute; #top:50%; display:table-cell;
vertical-align:middle;"&gt;
        &lt;div style="#position:relative; #top:-50%"&gt;
            &lt;!-- content to be centered --&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;</pre>
<p>I built a quick <a href="http://chrisjean.com/center_vertically.html" target="_blank">example document</a> that shows how I applied the rules via a style block in the head to keep the HTML clean.</p>
<p>As with my <a href="http://chrisjean.com/2009/09/24/taming-html-lists-across-all-browsers/" target="_blank">taming HTML lists fix</a>, I tested this successfully on the following browsers:</p>
<ul>
<li> OS X
<ul>
<li>Firefox 3.5</li>
<li>Safari 4</li>
</ul>
</li>
<li> Ubuntu (Linux)
<ul>
<li>Firefox 3.5</li>
<li>Google Chrome 4</li>
<li>Konqueror 4.2</li>
<li>Midori 0.1.2</li>
<li>Opera 10</li>
</ul>
</li>
<li> Windows
<ul>
<li>Firefox 3.5</li>
<li>Google Chrome 4</li>
<li>Internet Explorer 6, 7, and 8</li>
<li>Safari 4</li>
</ul>
</li>
</ul>
<p>Thank you Yuhu for the great solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2009/09/27/vertically-centering-html-content-via-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pushing a Webpage Footer to the Bottom of an HTML Page with CSS</title>
		<link>http://chrisjean.com/2009/09/25/pushing-a-webpage-footer-to-the-bottom-of-an-page-with-css/</link>
		<comments>http://chrisjean.com/2009/09/25/pushing-a-webpage-footer-to-the-bottom-of-an-page-with-css/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 05:00:51 +0000</pubDate>
		<dc:creator>Chris Jean</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>
		<category><![CDATA[Browser Wars]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://gaarai.com/?p=1565</guid>
		<description><![CDATA[Anyone that works with HTML and CSS will tell you that positioning things exactly where you want them to be is often times difficult. If you want to position something somewhere vertically, it becomes even worse. I just finished working on a theme where I needed to force the footer of the layout to the [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>Anyone that works with HTML and CSS will tell you that positioning things exactly where you want them to be is often times difficult. If you want to position something somewhere vertically, it becomes even worse.</p>
<p>I just finished working on a theme where I needed to force the footer of the layout to the very bottom of the page. While logically putting the footer after all the other content is easy, making it sit at the very bottom of the page even when the content doesn&#8217;t take up enough space to push it down there is quite difficult.</p>
<p>After struggling with getting this right for a couple of hours, I finally found a site that has done all the hard work for me. <a href="http://www.cssstickyfooter.com/" target="_blank">CSS Sticky Footer</a> is the site that saved my sanity.</p>
<p>CSS Sticky Footer provides a solution that sticks the footer to the bottom of the page in a cross-browser compliant manner. The site reports, and I can confirm, that it works with Internet Explorer 6 through Internet Explorer 8,  Firefox, Google Chrome, Safari, Opera, and Konqueror.</p>
<p>Since the implementation could change, I recommend that you visit the site to get details; however, just in case something happens to the site, I&#8217;m going to add the solution here as well.</p>
<p><span id="more-1565"></span></p>
<h3>HTML</h3>
<pre>&lt;div id="wrap"&gt;
    &lt;div id="main" class="clearfix"&gt;
        &lt;!-- non-footer content --&gt;
    &lt;/div&gt;
&lt;/div&gt;

&lt;div id="footer"&gt;
    &lt;!-- footer content --&gt;
&lt;/div&gt;</pre>
<h3>CSS</h3>
<pre>/*
Sticky Footer Solution
by Steve Hatcher

http://stever.ca

http://www.cssstickyfooter.com

*/

* {
    margin: 0;
    padding: 0;
}

/* must declare 0 margins on everything, also for main layout components
use padding, not vertical margins (top and bottom) to add spacing, else
those margins get added to total height and your footer gets pushed down
a bit more, creating vertical scroll bars in the browser */

html, body, #wrap {
    height: 100%;
}

body &gt; #wrap {
    height: auto;
    min-height: 100%;
}

#main {
    padding-bottom: 150px;  /* must be same height as the footer */
}

#footer {
    position: relative;
    margin-top: -150px;  /* negative value of footer height */
    height: 150px;
    clear: both;
} 

/* CLEAR FIX */
.clearfix:after {
    content: ".";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
}
.clearfix {
    display: inline-block;
}
/* Hides from IE-mac \*/
* html .clearfix {
    height: 1%;
}
.clearfix {
    display: block;
}
/* End hide from IE-mac */</pre>
<h3>Sample</h3>
<p>I have a <a href="http://chrisjean.com/css_sticky_footer.html" target="_blank">sample page</a> available to see this in action.</p>
<p>Many thanks to Steve Hatcher who made my job a lot easier.</p>
<h3>Update</h3>
<p>Someone reported that they have a roughly 45 pixel white gap at the bottom of footer of the sample and that they saw this on Firefox 3.5.3 on Vista. I&#8217;ve tested this on the exact same OS and browser, and I don&#8217;t see it. I&#8217;ve tested this on a huge variety of platforms, browsers, and browser versions, and I can&#8217;t see the gap. Does anyone else see any odd rendering?</p>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2009/09/25/pushing-a-webpage-footer-to-the-bottom-of-an-page-with-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Taming HTML Lists Across All Browsers</title>
		<link>http://chrisjean.com/2009/09/24/taming-html-lists-across-all-browsers/</link>
		<comments>http://chrisjean.com/2009/09/24/taming-html-lists-across-all-browsers/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 15:31:39 +0000</pubDate>
		<dc:creator>Chris Jean</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tips 'n Tricks]]></category>
		<category><![CDATA[Browser Wars]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://gaarai.com/?p=1552</guid>
		<description><![CDATA[It seems that every browser rendering engine has a completely different way of rendering lists. I recently had the frustrating job of getting them all to play nicely together. The CSS I ended up using is quite simple and works across all the browsers I tested (list at the bottom). This is the magic bit [...]]]></description>
			<content:encoded><![CDATA[<!-- filtered -->
<p>It seems that every browser rendering engine has a completely different way of rendering lists. I recently had the frustrating job of getting them all to play nicely together.</p>
<p>The CSS I ended up using is quite simple and works across all the browsers I tested (list at the bottom).</p>
<p>This is the magic bit of CSS:</p>
<pre>ul, ol {
    list-style-position: outside;
    margin: 0 0 0 15px;
    padding: 0;
}
ol {
    margin-left: 20px;
    *margin-left: 24px; /* targeted IE 6, 7 fix */
}
li {
    margin: 0;
    padding: 0;
}</pre>
<p>This CSS forces all the browsers to play by the same rules. The end results are nice and clean.</p>
<p>The left margins are necessary to get all the browsers to not clip part of the bullet/number; however, you can change this left margin on ul/ol elements contained within the primary ul/ol if you need to adjust the indentation of each sub-list.</p>
<p>Each browser that I tested rendered the same thing, albeit with slightly different bullets or padding in front of the number.</p>
<p>The following are the browsers I tested:</p>
<ul>
<li>
OS X</p>
<ul>
<li>Firefox 3.5</li>
<li>Safari 4</li>
</ul>
</li>
<li>
Ubuntu (Linux)</p>
<ul>
<li>Firefox 3.5</li>
<li>Google Chrome 4</li>
<li>Konqueror 4.2</li>
<li>Midori 0.1.2</li>
<li>Opera 10</li>
</ul>
</li>
<li>
Windows</p>
<ul>
<li>Firefox 3.5</li>
<li>Google Chrome 4</li>
<li>Internet Explorer 6, 7, and 8</li>
<li>Safari 4</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://chrisjean.com/2009/09/24/taming-html-lists-across-all-browsers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

