<?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>axing's blog &#187; Update</title>
	<atom:link href="http://xing.web.id/blog/category/update/feed/" rel="self" type="application/rss+xml" />
	<link>http://xing.web.id/blog</link>
	<description>Renew, reload, re-新の空</description>
	<lastBuildDate>Wed, 24 Jun 2009 13:14:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Tab CSS Fixing</title>
		<link>http://xing.web.id/blog/2008/11/tab-css-fixing/</link>
		<comments>http://xing.web.id/blog/2008/11/tab-css-fixing/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 09:58:01 +0000</pubDate>
		<dc:creator>axing</dc:creator>
				<category><![CDATA[Update]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Cross-browser]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://xing.web.id/blog/?p=40</guid>
		<description><![CDATA[I found error on my tab menu that I made it myself. The layout was messed on web browser which its layout engine is WebKit (Safari 3.1.2 or Google Chrome 0.2.152.1) or Presto (Opera 9.52) layout engine, but no problem was found in Mozilla Firefox 2.0.0.18, 3.0.4 and IE 7. Below are the screen shots [...]]]></description>
			<content:encoded><![CDATA[<p>I found error on my tab menu that I made it myself. The layout was messed on web browser which its layout engine is WebKit (Safari 3.1.2 or Google Chrome 0.2.152.1) or Presto (Opera 9.52) layout engine, but no problem was found in Mozilla Firefox 2.0.0.18, 3.0.4 and IE 7. Below are the screen shots of each web browser with different layout engine:</p>
<p><img class="thinborder" title="Safari 3.1.2 (Before)" src="http://xing.web.id/blog/wp-content/uploads/2008/11/before-safari312.gif" alt="bfsafari312" /><br />
<span class="redtext"> Safari 3.1.2</span></p>
<p><img class="thinborder" title="Google Chrome 0.2.152.1 (Before)" src="http://xing.web.id/blog/wp-content/uploads/2008/11/before-chrome021521.gif" alt="bfchrome021521" /><br />
<span class="redtext"> Google Chrome</span></p>
<p><img class="thinborder" title="Opera 9.52 (Before)" src="http://xing.web.id/blog/wp-content/uploads/2008/11/before-opera952.gif" alt="opera952" /><br />
<span class="redtext"> Opera 9.52</span></p>
<p><img class="thinborder" title="Mozilla Firefox 2.0.0.18 (Before)" src="http://xing.web.id/blog/wp-content/uploads/2008/11/before-ff20018.gif" alt="bfff20018" /><br />
<span class="greentext"> Mozilla Firefox 2.0.0.18</span></p>
<p><img class="thinborder" title="Mozilla Firefox 3.0.4 (Before)" src="http://xing.web.id/blog/wp-content/uploads/2008/11/before-ff304.gif" alt="bfff304" /><br />
<span class="greentext"> Mozilla Firefox 3.0.4</span></p>
<p><img class="thinborder" title="IE 6 (Before)" src="http://xing.web.id/blog/wp-content/uploads/2008/11/before-ie6.gif" alt="bfie6" /><br />
<span class="redtext"> IE 6</span></p>
<p><img class="thinborder" title="IE 7 (Before)" src="http://xing.web.id/blog/wp-content/uploads/2008/11/before-ie7.gif" alt="bfie7" /><br />
<span class="greentext"> IE 7</span></p>
<p>The layouts above were constructed by the following HTML and CSS:</p>
<p>HTML:</p>
<div class="code-snippet">
<pre><span style="color: black;">&lt;div <span style="color: #000066;">id</span><span style="color: #009900;">=</span></span><span style="color: red;">"globalnav"</span>&gt;
<span style="color: black;">  &lt;ul <span style="color: #000066;">id</span><span style="color: #009900;">=</span><span style="color: red;">"menu"</span>&gt;</span>
<span style="color: black;">    &lt;li <span style="color: #000066;">class</span><span style="color: #009900;">=</span><span style="color: red;">"page_item home-link current_page_item"</span>&gt;</span>
<span style="color: black;">      &lt;a <span style="color: #000066;">href</span><span style="color: #009900;">=</span>"<span style="color: red;">http://xing.web.id/blog/"</span>&gt;Blog&lt;/a&gt;</span>
<span style="color: black;">    &lt;/li&gt;</span>
<span style="color: black;">    &lt;li <span style="color: #000066;">class</span><span style="color: #009900;">=</span>"<span style="color: red;">page_item"</span>&gt;</span>
<span style="color: black;">      &lt;a <span style="color: #000066;">href</span><span style="color: #009900;">=</span>"<span style="color: red;">http://xing.web.id/blog/about/"</span>&gt;About&lt;/a&gt;</span>
<span style="color: black;">    &lt;/li&gt;</span>
<span style="color: black;">    &lt;li <span style="color: #000066;">class</span><span style="color: #009900;">=</span>"<span style="color: red;">page_item"</span>&gt;</span>
<span style="color: black;">      &lt;a <span style="color: #000066;">href</span><span style="color: #009900;">=</span>"<span style="color: red;">http://xing.web.id/blog/useronline/"</span>&gt;Who’s online?&lt;/a&gt;</span>
<span style="color: black;">    &lt;/li&gt;</span>
<span style="color: black;">    &lt;li <span style="color: #000066;">class</span><span style="color: #009900;">=</span>"<span style="color: red;">page_item"</span>&gt;</span>
<span style="color: black;">      &lt;a <span style="color: #000066;">href</span><span style="color: #009900;">=</span>"<span style="color: red;">http://xing.web.id/blog/lifestream/"</span>&gt;LifeStream&lt;/a&gt;</span>
<span style="color: black;">    &lt;/li&gt;</span>
<span style="color: black;">  &lt;/ul&gt;</span>
<span style="color: black;">&lt;/div&gt;</span></pre>
</div>
<p>CSS:</p>
<div class="code-snippet">
<pre class="css">div<span style="color: #cc00cc;">#globalnav</span> <span style="color: #66cc66;">&#123;</span></pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">border-bottom</span>: <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#<span style="color: #933;">005599</span></span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">height</span>: <span style="color: #933;">22px</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">margin</span>: -<span style="color: #933;">20px</span> <span style="color: #993333;">auto</span> <span style="color: #933;">15px</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">text-align</span>: <span style="color: #000000; font-weight: bold;">right</span>;</pre>
<pre class="css"><span style="color: #66cc66;">&#125;</span></pre>
<pre class="css">ul<span style="color: #cc00cc;">#menu</span> <span style="color: #66cc66;">&#123;</span></pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">list-style-image</span>: <span style="color: #993333;">none</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">list-style-position</span>: <span style="color: #993333;">outside</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">list-style-type</span>: <span style="color: #993333;">none</span>;</pre>
<pre class="css"><span style="color: #66cc66;">&#125;</span></pre>
<pre class="css">ul<span style="color: #cc00cc;">#menu</span> li<span style="color: #6666ff;">.page_item</span> <span style="color: #66cc66;">&#123;</span></pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">display</span>: <span style="color: #993333;">inline</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">padding</span>: <span style="color: #933;">0</span> <span style="color: #933;">10px</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">text-align</span>: <span style="color: #993333;">center</span>;</pre>
<pre class="css"><span style="color: #66cc66;">&#125;</span></pre>
<pre class="css">ul<span style="color: #cc00cc;">#menu</span> li<span style="color: #6666ff;">.current_page_item</span> <span style="color: #66cc66;">&#123;</span></pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">background</span>: <span style="color: #993333;">white</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">border-color</span>: <span style="color: #cc00cc;">#<span style="color: #933;">005599</span></span> <span style="color: #cc00cc;">#<span style="color: #933;">005599</span></span> <span style="color: #993333;">white</span> <span style="color: #cc00cc;">#<span style="color: #933;">005599</span></span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">border-style</span>: <span style="color: #993333;">solid</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">border-width</span>: <span style="color: #933;">1px</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">padding-bottom</span>: <span style="color: #933;">5px</span>;</pre>
<pre class="css"><span style="color: #66cc66;">&#125;</span></pre>
<pre class="css">ul<span style="color: #cc00cc;">#menu</span> li a <span style="color: #66cc66;">&#123;</span></pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">position</span>: <span style="color: #993333;">relative</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">text-decoration</span>: <span style="color: #993333;">none</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">top</span>: <span style="color: #933;">2px</span>;</pre>
<pre class="css"><span style="color: #66cc66;">&#125;</span></pre>
</div>
<p>I tried to figure out where the problems were. Then I found:</p>
<ul>
<li><strong>&lt;ul&gt;</strong> has its default top and bottom margin and this is critical, so I fix it by adding <strong>margin:0px;</strong> to <strong>ul#menu</strong></li>
<li>The bottom border of <strong>div#globalnav</strong> supposed to be covered by current selected page style of <strong>&lt;li&gt;</strong> (<strong>.current_page_item</strong>), but I made a mistake, I put these styles:
<pre class="css"><span style="color: #000000; font-weight: bold;">position</span>: <span style="color: #993333;">relative</span>;</pre>
<pre class="css"><span style="color: #000000; font-weight: bold;">top</span>: <span style="color: #933;">2px</span>;</pre>
<p>in <strong>ul#menu li a</strong> that didn't achieve my purpose. So I move them to <strong>ul#menu li.page_item</strong></li>
<li>There's 1px difference of <strong>&lt;li&gt;</strong> position (height? or padding?) between Gecko and WebKit. WebKit somehow more 1px than Gecko. Sigh, I have no idea if by using CSS could solve my problem (of course I had tried several ways, but didn't working). So I used a small hacking, I put a <strong>&lt;div&gt;</strong> (<strong>id="hack"</strong>) right under the <strong>&lt;div id="globalnav"&gt;</strong> with the following style:
<pre class="css"><span style="color: #000000; font-weight: bold;">background</span>: <span style="color: #993333;">white</span>;</pre>
<pre class="css"><span style="color: #000000; font-weight: bold;">height</span>: <span style="color: #933;">15px</span>;</pre>
<p>Since the <strong>ul#menu li.page_item</strong> had been styled <strong>position: relative;</strong>, it will stays on the top of every element. In this case, element stacking order rule is definitely needed here to be applied well. So, I simply give <strong>position: relative;</strong> in <strong>div#hack</strong>.</li>
</ul>
<p>Voila!</p>
<div class="code-snippet">
<pre class="css">div<span style="color: #cc00cc;">#globalnav</span> <span style="color: #66cc66;">&#123;</span></pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">border-bottom</span>: <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#<span style="color: #933;">005599</span></span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">height</span>: <span style="color: #933;">20px</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">text-align</span>: <span style="color: #000000; font-weight: bold;">right</span>;</pre>
<pre class="css"><span style="color: #66cc66;">&#125;</span></pre>
<pre class="css">ul<span style="color: #cc00cc;">#menu</span> <span style="color: #66cc66;">&#123;</span></pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">list-style-image</span>: <span style="color: #993333;">none</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">list-style-position</span>: <span style="color: #993333;">outside</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">list-style-type</span>: <span style="color: #993333;">none</span>;</pre>
<pre class="css">  margin<span style="color: #3333ff;">:<span style="color: #933;">0px</span></span>;</pre>
<pre class="css"><span style="color: #66cc66;">&#125;</span></pre>
<pre class="css">ul<span style="color: #cc00cc;">#menu</span> li<span style="color: #6666ff;">.page_item</span> <span style="color: #66cc66;">&#123;</span></pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">display</span>: <span style="color: #993333;">inline</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">padding</span>: <span style="color: #933;">3px</span> <span style="color: #933;">10px</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">position</span>: <span style="color: #993333;">relative</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">top</span>: <span style="color: #933;">2px</span>;</pre>
<pre class="css"><span style="color: #66cc66;">&#125;</span></pre>
<pre class="css">ul<span style="color: #cc00cc;">#menu</span> li<span style="color: #6666ff;">.current_page_item</span> <span style="color: #66cc66;">&#123;</span></pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">background</span>: <span style="color: #993333;">white</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">border-color</span>: <span style="color: #cc00cc;">#<span style="color: #933;">005599</span></span> <span style="color: #cc00cc;">#<span style="color: #933;">005599</span></span> <span style="color: #993333;">white</span> <span style="color: #cc00cc;">#<span style="color: #933;">005599</span></span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">border-style</span>: <span style="color: #993333;">solid</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">border-width</span>: <span style="color: #933;">1px</span>;</pre>
<pre class="css"><span style="color: #66cc66;">&#125;</span></pre>
<pre class="css">ul<span style="color: #cc00cc;">#menu</span> li a <span style="color: #66cc66;">&#123;</span></pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">text-decoration</span>: <span style="color: #993333;">none</span>;</pre>
<pre class="css"><span style="color: #66cc66;">&#125;</span></pre>
<pre class="css">div<span style="color: #cc00cc;">#hack</span> <span style="color: #66cc66;">&#123;</span></pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">background</span>: <span style="color: #993333;">white</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">height</span>: <span style="color: #933;">15px</span>;</pre>
<pre class="css">  <span style="color: #000000; font-weight: bold;">position</span>: <span style="color: #993333;">relative</span>;</pre>
<pre class="css"><span style="color: #66cc66;">&#125;</span></pre>
</div>
<p>Screenshots:<br />
<img class="thinborder" title="Safari 3.1.2 (After)" src="http://xing.web.id/blog/wp-content/uploads/2008/11/after-safari312.gif" alt="afsafari312" /><br />
<span class="greentext"> Safari 3.1.2</span></p>
<p><img class="thinborder" title="Google Chrome 0.2.152.1 (After)" src="http://xing.web.id/blog/wp-content/uploads/2008/11/after-chrome021521.gif" alt="afchrome021521" /><br />
<span class="greentext"> Google Chrome</span></p>
<p><img class="thinborder" title="Opera 9.52 (After)" src="http://xing.web.id/blog/wp-content/uploads/2008/11/after-opera952.gif" alt="afopera952" /><br />
<span class="greentext"> Opera 9.52</span></p>
<p><img class="thinborder" title="Mozilla Firefox 2.0.0.18 (After)" src="http://xing.web.id/blog/wp-content/uploads/2008/11/after-ff20018.gif" alt="afff20018" /><br />
<span class="greentext"> Mozilla Firefox 2.0.0.18</span></p>
<p><img class="thinborder" title="Mozilla Firefox 3.0.4 (After)" src="http://xing.web.id/blog/wp-content/uploads/2008/11/after-ff304.gif" alt="afff304" /><br />
<span class="greentext"> Mozilla Firefox 3.0.4</span></p>
<p><img class="thinborder" title="IE 6 (After)" src="http://xing.web.id/blog/wp-content/uploads/2008/11/after-ie6.gif" alt="afie6" /><br />
<span class="greentext"> IE 6</span></p>
<p><img class="thinborder" title="IE 7 (After)" src="http://xing.web.id/blog/wp-content/uploads/2008/11/after-ie7.gif" alt="afie7" /><br />
<span class="greentext"> IE 7</span></p>
<p>Well, while I was testing on WebKit browser, I found something very odd (or rather I call it a 'bug'?) and this really took me whole day finding out the problem. This bug only occur on WebKit browser. I'll write this WebKit layout bug at another post.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://xing.web.id/blog/2008/11/tab-css-fixing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
