<?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>Tech Hive &#124; Front End Development, etcetera &#187; CSS</title>
	<atom:link href="http://tech-hive.com/topic/front-end/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://tech-hive.com</link>
	<description>Mae Paulino</description>
	<lastBuildDate>Thu, 12 Aug 2010 21:00:00 +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>The CSS3 Carousel Experiment</title>
		<link>http://tech-hive.com/front-end/css/css-animation-20100806/</link>
		<comments>http://tech-hive.com/front-end/css/css-animation-20100806/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 09:17:00 +0000</pubDate>
		<dc:creator>Mae</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[carousel]]></category>
		<category><![CDATA[css carousel]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[sample codes]]></category>

		<guid isPermaLink="false">http://tech-hive.com/?p=90</guid>
		<description><![CDATA[When I first read about CSS Animation, I thought that they shouldn&#8217;t be messing with the separation of logic and style. In my mind, it should be clear that logic (animation, rotation, even the alternating row styles) should be in &#8230; <a href="http://tech-hive.com/front-end/css/css-animation-20100806/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When I first read about <a title="CSS Animation in Webkit - October 31, 2007" href="http://webkit.org/blog/138/css-animation/">CSS Animation</a>, I thought that they shouldn&#8217;t be messing with the separation of logic and style. In my mind, it should be clear that logic (animation, rotation, even the alternating row styles) should be in javascript, all the styles should be in CSS, and the document structure in HTML.</p>
<p>One time, while working on our internal project, I thought I&#8217;d try a little <code>-webkit-transition-duration</code> because I wanted the color of the links to gradually change to something else on hover. But when I hovered on our main navigation that was using a sprite image, the background <em>scrolled</em> from one background position to the next every time we hover on it because of the delay! It was really amusing.</p>
<h3>CSS3 Carousel</h3>
<p>I experimented a little bit with transition and descendant selectors<del datetime="2010-08-05T07:01:00+00:00">, but apparently, <code>p ~ p</code> doesn&#8217;t work with <code>:hover</code> or <code>:active</code> or <code>:focus</code> very well</del> (browser notes below) and came up with this <a href="http://tech-hive.com/experiments/animation/carousel.html">CSS3 carousel experiment</a>.</p>
<p>To do this, you should have the following markup:</p>
<pre><code>&lt;div class="carousel"&gt;
  &lt;a href="#" class="first-image"&gt;1&lt;/a&gt;
  &lt;a href="#" class="second-image"&gt;2&lt;/a&gt;
  &lt;a href="#" class="third-image"&gt;3&lt;/a&gt;
  &lt;a href="#" class="fourth-image"&gt;4&lt;/a&gt;
  &lt;img src="main-background.jpg" alt="" /&gt;
&lt;/div&gt;</code></pre>
<p>It&#8217;s really rather plain, it&#8217;s because we&#8217;ll be choosing the image using CSS&#8217; child selectors to move the image and it won&#8217;t work if we enclose the links in a div or list.</p>
<p>And this CSS:</p>
<pre><code>  img { -webkit-transition: all 5s; -o-transition: all 5s; }
  .carousel { width: 500px; height: 372px; overflow: hidden; }
  a.first-image:hover ~ img { margin-left: 0; }
  a.second-image:hover ~ img { margin-left: -500px; }
  a.third-image:hover ~ img { margin-left: -1000px; }
  a.fourth-image:hover + img { margin-left: -1500px; }</code></pre>
<p id="ecsstender">New child selectors: the <code>~</code> symbol is used to select all fellow child elements, in this case, an image. If you add another image, it will be selected by this, too. The <code>+</code> sign on the other hand is to select a descendant that directly follows it. It&#8217;s really exciting, go nuts! <sup><a href="#ecsstender-link">1</a></sup></p>
<div class="message note">
<p>Some people would obviously rather use a div and apply the image as background, all you have to do is replace img with div or the class you assigned to it.</p>
</div>
<h3>Browser (in)compatibilities:</h3>
<ul>
<li>For some reason, webkit-based browsers doesn&#8217;t interpret this very well, the second and third link can&#8217;t be triggered unless you hover on the fourth link first.</li>
<li>Firefox interprets the child selectors perfectly but not transition because it will only be implemented in <a href="https://developer.mozilla.org/en/CSS/-moz-transition#Browser_compatibility">Firefox 4</a>.</li>
<li>The experiment works perfectly in Opera 10.6 and it gives me a warm fuzzy feeling inside. :D</li>
</ul>
<div class="more_reading">
<h3>Further Reading:</h3>
<ul>
<li><a href="http://webkit.org/specs/CSSVisualEffects/">CSS Visual Effects Specs from Webkit</a></li>
<li><a href="http://css3.bradshawenterprises.com/">CSS3 Transitions, Transforms and Animations</a> &mdash; There is an example for CSS3 Carousel here, too. It uses js to move from one image to the next so I think this will give you more flexibility in writing your HTML.</li>
<li><a href="http://www.the-art-of-web.com/css/css-animation/">CSS Animation from Art of Web</a></li>
<li><a href="http://www.the-art-of-web.com/css/timing-function/">Timing Function from Art of Web</a></li>
<li><a href="http://24ways.org/2009/css-animations">CSS Animations from 24Ways</a></li>
<li><a href="http://www.cssplay.co.uk/menu/animation.html">CSS Flick Animation from CSSPlay</a></li>
<li id="ecsstender-link"><sup><a href="#ecsstender" title="Go back to the child selector paragraph">^</a></sup> <a href="http://test.ecsstender.org/extensions/eCSStender.CSS3-selectors.js/test/sizzle-test.html">Child selector support test and examples from eCSStender</a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://tech-hive.com/front-end/css/css-animation-20100806/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random CSS tips and tricks</title>
		<link>http://tech-hive.com/front-end/css/random-css-tips-and-tricks-20080916/</link>
		<comments>http://tech-hive.com/front-end/css/random-css-tips-and-tricks-20080916/#comments</comments>
		<pubDate>Tue, 16 Sep 2008 08:45:03 +0000</pubDate>
		<dc:creator>Mae</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[browser incompatibility]]></category>
		<category><![CDATA[CSS tips]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[sample codes]]></category>

		<guid isPermaLink="false">http://tech-hive.com/?p=10</guid>
		<description><![CDATA[I wrote (as in handwritten) this a couple of weeks ago when I was having trouble sleeping, chances are you already know these things but, for the benefit of my rusty memory, I&#8217;ll still post it here. Besides, solving these &#8230; <a href="http://tech-hive.com/front-end/css/random-css-tips-and-tricks-20080916/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I wrote (as in handwritten) this a couple of weeks ago when I was having trouble sleeping, chances are you already know these things but, for the benefit of my rusty memory, I&#8217;ll still post it here. Besides, solving these problems took me hours of frustration, so I better chronicle it. :(</p>
<ul>
<li>There are times when list items occupy a huge space in IE even though you&#8217;re sure that you haven&#8217;t specified excessive paddings and margins to it. Setting the list item&#8217;s <code>display</code> value to <code>inline-block</code> will solve this (I&#8217;m a little surprised that IE 6 can interpret this value because I&#8217;ve always thought that it only knows <code>block</code> and <code>inline</code>, that&#8217;s how little I think of it).
<p><code>Inline</code> doesn&#8217;t allow paddings and margins at the top and bottom area of the elements, however, it also means losing the width and layout of the element. In <code>inline-block</code>, we achieve just that, lose the excess top and bottom spaces while still being able to maintain the layout of the element. (That is, based on my understanding)</p>
<p>And in some bizarre cases, <code>inline</code> will do and yes, it will still look like it&#8217;s a block item and will just take out the excess margin, weird, yes?  I wish I have an explanation for this.</li>
<li>There are numerous times and reasons why we want to set <code>list-style</code> to <code>none</code>. What sucks is that after you&#8217;ve turned off the <code>list-style</code> to the parent list item, you&#8217;d realize that you want the bullets to show in the children element.
<p>All hell breaks lose when no matter what head-banging you do, it just won&#8217;t show up. Thankfully, <code>display: list-item</code> is there to restore the bullets and is working in IE too!</li>
<li>List items are supposed to line up neatly even when a float is used to an image before it. However, there are times when that&#8217;s not the case in, you guess it! <em>IE 6</em>. Standards-aware browsers will be solved by adding:
<pre><code>{ overflow:hidden; list-item-position:inside; }</code></pre>
<p>The result may be that the bullet may be a little too close to the text but at least it&#8217;s not below the list item just like in IE. The trick is to use <code>display:inline-block</code> too.</li>
<li>Not all of the CSS problems are in IE. Sometimes the great Fx 2 has some quirks too. It usually happens in the useful, albeit a little used, <em>autocomplete function</em>. What usually happens is that the autocomplete items go under the <code>div</code> elements below it.
<p>Here&#8217;s what I usually do:</p>
<p>HTML</p>
<pre><code>&lt;div class="parent_element"&gt;
  &lt;div class="autocomplete"&gt;
    &lt;ul&gt;
      &lt;li&gt;Value here&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
&lt;/div&gt;</code></pre>
<p>CSS</p>
<pre><code>.parent_element { position:relative; z-index:99; overflow:visible; }</code></pre>
<p>What my understanding of this is that once the <code>z-index</code> is set, then it lifts the entire <code>div</code> and everything within it above every other element in the page therefore eliminating the problem.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://tech-hive.com/front-end/css/random-css-tips-and-tricks-20080916/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>min-height in IE 6</title>
		<link>http://tech-hive.com/front-end/css/min-height-in-ie-6-20080831/</link>
		<comments>http://tech-hive.com/front-end/css/min-height-in-ie-6-20080831/#comments</comments>
		<pubDate>Sun, 31 Aug 2008 08:53:24 +0000</pubDate>
		<dc:creator>Mae</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS tips]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[sample codes]]></category>

		<guid isPermaLink="false">http://tech-hive.com/?p=21</guid>
		<description><![CDATA[Would you look at this, while everyone has finally decided that they will be dropping support for IE 6, that&#8217;s when I decided to create a tutorial for implementing min-height for the browser. Anyway, onto the post. We all know &#8230; <a href="http://tech-hive.com/front-end/css/min-height-in-ie-6-20080831/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Would you look at this, while everyone has finally decided that they will be dropping support for <code>IE 6</code>, that&#8217;s when I decided to create a tutorial for implementing <code>min-height</code> for the browser. Anyway, onto the post.</p>
<p>We all know that the <code>min-height</code> property doesn&#8217;t work in <code>IE 6</code>. Instead, the <code>height</code> property acts as both the element&#8217;s <code>height</code> and <code>min-height</code>. Its role will ultimately rely on the value of your <code>overflow</code> property.</p>
<p>If the <code>overflow</code> property is set to <code>hidden</code> then the height of the element is its <code>max-height</code>. If set on <code>visible</code>, however, then it will be its <code>min-height</code>.</p>
<h3><code>Overflow: Visible</code></h3>
<p>The element will take up the specified height and when the content of the element exceeds the height then the element will just expand vertically (or horizontally, if it needs to). You can define whether the it will expand vertically of horizontally by specifying the value for <code>overflow-y</code> (vertically) or <code>overflow-x</code> (horizontally) (your CSS document won&#8217;t validate for CSS 2.1 though, but it&#8217;s valid once tested against CSS 3).</p>
<p>So your CSS (for IE 6) will look something like this:</p>
<pre><code>div.parent-element { height:300px; overflow-y:visible; overflow-x:hidden; }</code></pre>
<h3>The Complexities that <code>hasLayout</code> Brings</h3>
<p>There are some instances when you have to define the <code>height</code> and <code>overflow</code> properties of an element (usually applicable to lists) to meet the demands of the <code>hasLayout</code> curse in IE. In these instances, you will have to add a bogus height and <code>overflow:hidden</code> thinking that it will not bring harm to your design.</p>
<p>That is until you wanted to add a <code>min-height</code> to the parent <code>div</code>.</p>
<p>If your bogus height is set to 1%, you element will collapse. Setting the <code>height</code> to <code>auto</code> will render your layout worse than before because that means that your element &#8220;will not have a layout&#8221; (ie, your <code>hasLayout</code> is nonexistent in IE).</p>
<p>Setting the <code>height</code> to 100%, however, will then expand your element to the height of its parent <code>div</code> (or element).</p>
<p>You can solve this dilemma by changing your <code>overflow</code> value from <code>hidden</code> to <code>visible</code> and setting the height of your element (usually, list items) to 1% just to retain the bogus height.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech-hive.com/front-end/css/min-height-in-ie-6-20080831/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lessons learned in dealing with IE 6</title>
		<link>http://tech-hive.com/front-end/css/lessons-learned-in-dealing-with-ie-6-20080617/</link>
		<comments>http://tech-hive.com/front-end/css/lessons-learned-in-dealing-with-ie-6-20080617/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 08:41:18 +0000</pubDate>
		<dc:creator>Mae</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[browser incompatibility]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://tech-hive.com/?p=8</guid>
		<description><![CDATA[I&#8217;ve been &#8220;battling&#8221; with IE for more than 3 years now and I just felt that it&#8217;s finally time to not only bash the poor beloved browser and instead pay homage to the good things that it was able to &#8230; <a href="http://tech-hive.com/front-end/css/lessons-learned-in-dealing-with-ie-6-20080617/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been &ldquo;battling&rdquo; with IE for more than 3 years now and I just felt that it&#8217;s finally time to not only bash the poor <del datetime="2008-06-17T10:00:29+00:00">beloved</del> browser and instead pay homage to the good things that it was able to instill on me.</p>
<h3>There is no such thing as one tweak fix all</h3>
<p>If there&#8217;s such a thing, the guy (or girl) who was able to find that tweak would&#8217;ve been a bajillionaire by now. That or he/she&#8217;s<del datetime="2008-06-17T10:00:29+00:00">, unfortunately</del> probably a Microsoft employee by now.</p>
<h3>Patience is a virtue (and a very important skill)</h3>
<p>There was a time before when I was able to &ldquo;fix&rdquo; a specific IE bug in one of my dreams. I can&#8217;t remember what that bug was though, but I&#8217;m sure that happened, because that also happened when I was trying to play with WordPress before.</p>
<p>Anyway, I think IE is a great therapy for people who need to manage their angers. I used to be very explosive when I&#8217;m angry or when I can&#8217;t find a solution to a problematic rendering error. Sure, you can say that I matured a little but I think that if IE&#8217;s following my every whim all the time, then I don&#8217;t think I would be used to seeing any design screwed up in the <del datetime="2008-06-17T10:00:29+00:00">blasted</del> <del datetime="2008-06-17T10:00:29+00:00">beloved</del> browser.</p>
<h3>If it fixed your problem&#8230;</h3>
<p>Chances are that it opened a LOT of seemingly unrelated problems waiting to be discovered. I fixed a height problem and the next thing I know, the other elements (who are important at that!) are not showing up anymore. So be wary, be very, very wary about that hacks and fixes.</p>
<h3>With IE, anything is possible</h3>
<p>I honestly have a feeling that the Murphy&#8217;s Law was created with IE in mind, no kidding! If you think that there&#8217;s no way that any element will collapse specially if you already specified its width and height, then expect IE to crush that belief of yours.</p>
<h3>If you&#8217;re dealing with IE, it&#8217;s OK to be paranoid</h3>
<p>And check, and check, and check. There was a time when an office mate and I was checking the same site in IE, just different machines and it&#8217;s rendering differently. Seriously.</p>
<h3>If your element collapsed in IE, chances are that it doesn&#8217;t have a <code>haslayout</code></h3>
<p>And that usually means you need to add a <code>height</code> and <code>width</code> to your element and if that still did not work, add an <code>overflow:hidden</code>. Sometimes that still won&#8217;t work so you have to add a <code>display:block</code>. That usually does the trick. If you don&#8217;t want to add a specific height however, you can add <code>1%</code> or <code>100%</code> as its value, anything as long as it&#8217;s not <code>auto</code> or a pixel or <code>em</code>. Be careful though, if you add a height to its parent div, it&#8217;ll take the height of its parent.</p>
<h3>I could never stress this enough &#8212; <code>haslayout</code> is everything in IE</h3>
<p>If your element is inline, then it&#8217;s fine, but if it&#8217;s a block-level element we&#8217;re talking about, grab the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038&#038;displaylang=en">IE dev toolbar</a> and hunt for that ever-elusive <code>haslayout</code> property.</p>
<p>Sidenote: Want to run 2 IE in the same machine? Download IE 6 and then download a copy of <a href="http://tredosoft.com/IE7_standalone">IE 7 standalone</a>, yes, it&#8217;s necessary that it&#8217;s in that order and not the other way around because last time I had IE 7 as my default browser and got the IE 6 standalone, IE dev toolbar no longer worked which is one of the things that enabled me to keep my sanity back then.</p>
<h3>Before using an IE hack, check out if you can solve the problem without it.</h3>
<p> Yes, even if it drives you insane. It&#8217;s daunting, it&#8217;s scary, but it&#8217;s to be done. I hate to look at an IE6 specific stylesheet that contains more or less 100 lines of code. If it&#8217;s a problem with margins, try to see if the changes you need to do will make such a big impact to the other browsers, if it&#8217;s hardly noticeable then apply the fix in your main stylesheet. Now if we&#8217;re talking about 20-25 pixels (or more) difference then by all means, do it in a separate stylesheet.</p>
<h3>IE6 doesn&#8217;t want &lt;tr&gt; to have borders</h3>
<p>It&#8217;s annoying when I realized that. I thought the problem was that the table doesn&#8217;t have <code>haslayout</code> (how can a table not have a haslayout when it&#8217;s a block-level element by default, yes?!) that&#8217;s why the borders won&#8217;t show up. Turns out that IE doesn&#8217;t render a border when it&#8217;s in the <code>&lt;tr&gt;</code> tag, you have to add the border in the <code>&lt;td&gt;</code> tag and don&#8217;t forget to add <code>border-collapse:collapse</code> for your <code>table</code> so that the border will look continuous.</p>
<h3>Test again and again and again</h3>
<p>I told this to you before, remember? You can never be too sure with IE so you <em>must</em> be paranoid. You <em>must</em> be an OC and you must never forget to expect the worst case scenarios.</p>
<p>So there! What IE taught me so far, anyone else want to throw in some ideas too?</p>
<p>One unrelated musing, do you know that I just finally realized that this sign &lt; stands for less than and &gt; stands for greater than. It&#8217;s stupid, <strong>I know</strong> but it&#8217;s true! And guess what finally taught me this very &ldquo;complicated&rdquo; mathematical symbol. </p>
<div class="message note">
<strong>HTML!</strong></p>
<p>The less than (&lt;) sign&#8217;s equivalent (just in case you didn&#8217;t know) is &amp; lt; and the greater than (&gt;) sign&#8217;s equivalent is &amp; gt;. Finally, it&#8217;s out of my system.
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://tech-hive.com/front-end/css/lessons-learned-in-dealing-with-ie-6-20080617/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The great IE 6 Hack</title>
		<link>http://tech-hive.com/front-end/css/the-great-ie-6-hack-20080422/</link>
		<comments>http://tech-hive.com/front-end/css/the-great-ie-6-hack-20080422/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 08:45:40 +0000</pubDate>
		<dc:creator>Mae</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[browser incompatibility]]></category>
		<category><![CDATA[htc]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://tech-hive.com/?p=13</guid>
		<description><![CDATA[As a designer, the biggest problems that I have with IE are the PNG transparency problem and the :hover pseudo class is not working unless it&#8217;s used in the a element. Thanks for HTC which is only understood by IE &#8230; <a href="http://tech-hive.com/front-end/css/the-great-ie-6-hack-20080422/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As a designer, the biggest problems that I have with IE are the PNG transparency problem and the <code>:hover</code> pseudo class is not working unless it&#8217;s used in the <code>a</code> element.</p>
<p>Thanks for <acronym title="HTML Components">HTC</acronym> which is only understood by IE 5.5 and above browsers &#8212; I&#8217;ve found some handy &ldquo;hacks&rdquo; to work around these 2 limitations on the browser designers/programmers&#8217; love to hate.</p>
<p>Note: calling it in CSS will make your CSS file invalid even though it&#8217;s a part of <a href="http://reference.sitepoint.com/css/behavior" title="Site Point CSS Reference">CSS property lists</a>, I tested it against CSS 1, 2, 2.1 and 3 (just to be sure) so&#8230; CSS valid-freaks sorry&#8230; <em><a href="http://www.w3.org/TR/1999/WD-becss-19990804" title="Behavioral Extensions to CSS -- W3C Working Draft August 1999">Maybe it remained to be just a part of the draft?</a></em> </p>
<h3>PNG Transparency</h3>
<p>I have to admit that I haven&#8217;t really looked <em>that</em> hard for PNG transparency hacks, sure you can use PNG 8 but, isn&#8217;t it just a <em>&ldquo;PNGized&rdquo;</em> GIF? Anyway, if you&#8217;re certain that you won&#8217;t be using your image on plain backgrounds and your background does not have patterns on them then PNG 8 will be a good solution.</p>
<p>So, while I was looking for a hack to make PNG work on IE 6, I came across <a href="http://www.twinhelix.com/css/iepngfix/">IE PNG Fix of Twinhelix</a> which is a good enough solution for me because it doesn&#8217;t complicate things for me and it also works on PNG backgrounds on CSS and images you have to insert into your HTML file. However, this being a &ldquo;hack&rdquo;, of course it has some limitations too.</p>
<p>The list is from the author, the ones that with emphasis are mine.</p>
<ul>
<li>Can&#8217;t help IE versions prior to 5.5, sorry.</li>
<li>Users can&#8217;t right-click-save processed PNG images, they&#8217;ll save the blank GIF file if they try that. In some cases this might be a feature, not a bug&#8230;</li>
<li>The script detects the &#8220;.png&#8221; extension in image URLs. So if you have a CGI script that generates a PNG image, you may have to rewrite parts of the script, or just cache them as PNG files somewhere. <strong>Apparently, this is also an issue in RoR, I really don&#8217;t know why but the images will still not be transparent unless you specifically call the image using the <code>&lt;img&gt;</code> tag, so say goodbye to your <code>&lt;%= image_tag("path_to_file_here") %&gt;</code> way of calling images (unless it&#8217;s a JPG or GIF of course).</strong></li>
<li>It&#8217;s most reliable on elements with non-&#8217;auto&#8217; dimensions set. So, give images and other elements width/height values; &#8217;100%&#8217;, &#8217;10em&#8217; and &#8217;200px&#8217; and so on are all OK<strong>, otherwise, you will have a heart attack once you&#8217;ve seen it in IE, it&#8217;s transparent, yes but still, it is not pretty</strong>.</li>
<li>Background PNG images can&#8217;t be tiled. This is a limitation of the IE filter.</li>
<li>Similarly, padding and borders don&#8217;t indent the PNG image. An easy fix for this is wrapping your PNG images in container <code>DIV</code>s or similar.</li>
<li>There may be about a short time as soon as the image loads when images are not transparent, before the IE filter kicks in.</li>
</ul>
<p>For it to work, all you have to do is create a blank transparent GIF file (it doesn&#8217;t matter what size it is) put the path to it in the htc file and call the htc by adding</p>
<p><code>* { behavior: url(/path_to/iepngfix.htc) }</code></p>
<p>anywhere in your CSS file. Note that you can replace * with img or whatever element you want. Then voila! PNG transparency has been achieved.</p>
<h3>Applying <code>:hover</code> pseudo class for whatever element in IE 6</h3>
<p>As I&#8217;ve said before, another shortcoming of IE 6 is that it only applies the <code>:hover</code> pseudo class on the <code>a</code> element so it&#8217;s really hard to create a hover state for menu items using the sliding door technique unless all you have to do is change the menu item&#8217;s link color. Unless you love cutting images for specific menu items or your item&#8217;s width is fixed and don&#8217;t care what it&#8217;ll look like once you have increased the font size, then I guess you need not worry about it.</p>
<p>Anyway, this time, I need not look so hard because of <a href="http://www.xs4all.nl/~peterned/csshover.html">whatever:hover</a> yey! All you have to do is put the htc file anywhere in your site, call it in your CSS using the behavior property again like so &#8211;</p>
<p><code>* { behavior: url(/path_to/csshover.htc) }</code></p>
<p>(again you can change * to whatever element you want) and voila! You can apply the <code>:hover</code> pseudo class to whatever element that you want and you can be absolutely certain that it will be reflected in IE 6. Lovely. :)</p>
<p>Is there a hack for IE 6 that you know? Please do share. :)</p>
<p><ins datetime="2008-04-28T06:21:37+00:00">Update (April 28, 2008): <a href="http://www.taintedsong.com">Joni</a> buzzed me earlier to ask if maybe adding the behavior property in a stylesheet that&#8217;s meant only for IE will make your stylesheet valid. I tried it at <a href="http://www.lastleaf.org">Last Leaf</a> and it did! So&#8230; now you can make your site valid even though you&#8217;re using htc. I can&#8217;t believe I failed to test that when I&#8217;ve been using IE conditionals for more than a year already! hehe Credit to Joni Ang, XHTML/CSS/Wordpress theme designer extraordinaire :) Also, if you&#8217;re using wordpress and you added htc within your theme&#8217;s folder, don&#8217;t forget to add the complete path to your blank.gif and htc, otherwise, it won&#8217;t work.</ins></p>
]]></content:encoded>
			<wfw:commentRss>http://tech-hive.com/front-end/css/the-great-ie-6-hack-20080422/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Being productive with CSS</title>
		<link>http://tech-hive.com/front-end/css/being-productive-with-css-20070611/</link>
		<comments>http://tech-hive.com/front-end/css/being-productive-with-css-20070611/#comments</comments>
		<pubDate>Mon, 11 Jun 2007 08:39:54 +0000</pubDate>
		<dc:creator>Mae</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS tips]]></category>
		<category><![CDATA[generic classes]]></category>
		<category><![CDATA[sample codes]]></category>

		<guid isPermaLink="false">http://tech-hive.com/?p=6</guid>
		<description><![CDATA[I don&#8217;t know about other people but I, for one, use a lot of classes in every design project. So with every project that I have to code, I have to put all of them again and again and again &#8230; <a href="http://tech-hive.com/front-end/css/being-productive-with-css-20070611/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know about other people but I, for one, use a lot of classes in every design project. So with every project that I have to code, I have to put all of them again and again and again that there are moments that I was not able to add some of them altogether. </p>
<p>For example are the classes that enables you to float a certain element (to use for images and whatnots), I always call it alignright or alignleft, always. I have never thought <strong>how slow that made me in creating CSS</strong> because every time I do one I tend to forget one or more class (or element) or worse, <strong>I forget how I was able to do it in one site</strong> (e.g. losing the quotation marks in quote tags) that I have to open the CSS file for that site again. I have always thought of <strong>creating a default CSS that will have all of the classes that I always use</strong> plus the default appearance of almost all of the elements.</p>
<p>Classes it is understandable but why elements you ask? Well, one main reason is still the pesky IE. IE does not render quote tags the same way that the new browsers do, i.e. they do not put quotation marks before and after the quote tags to signify that it is a quote. So what I do is take out the quote on all of the browsers in CSS and instead put the hex decimal for quotation marks &#8212; <strong><code>&#038;ldquo ;</code> <em>(minus the space)</em> for left quote and <code>&#038;rdquo ;</code> for right quotes</strong>. If we have to lose support for IE 6, I have to say that it will be pretty hard to maintain. But that may not for how many years from now.</p>
<p>So, here is what my default CSS looks like, feel free to use it if you like:</p>
<pre><code>a img {
   border:0 none;
}
q:after, q:before {
   content: ''
}
code, samp, kbd, pre, tt {
   font-size: 115%;
}
pre code, code pre {
   font-size:100%;
}
acronym, abbr {
   border-bottom: 1px dotted #000; cursor: help;
}
dfn {
   font-style: italic;
}
dl dt {
   font-weight: bold;
}
dl dd {
   margin-left: 0; margin-bottom:.8em;
}
ul li, ol li {
   margin-bottom: .3em;
}
fieldset {
   border:0 none;
}
th, caption {
   text-align: center;
}
legend {
   font-weight: bold;
   font-size: 120%;
}
input, select, textarea {
   padding:.2em;
}

.clear {
   clear: both;
}
.right {
   text-align: right;
}
.left {
   text-align: left;
}
.alignright {
   float:right;
   margin-left: .8em;
   margin-bottom: .8em;
}
.alignleft {
   float:left;
   margin-right: .8em;
   margin-bottom:.8em;
}
.center {
   text-align: center;
}
.strong {
   font-weight:bold;
}
.italic {
   font-style: italic;
}
.navigation {
   padding: .8em 0;
   text-align: center;
   font-family: Georgia, "Times New Roman", Times, serif;
   font-size: 105%;
   font-weight: bold;
}
	.navigation ul, navigation li {
            list-style: none;
            margin: 0;
            padding: 0; }
	.navigation li {
            display: inline;
            list-style:none;
}</code></pre>
<p>Have I missed to style any important element?</p>
<p>I used relative measurements so that I don&#8217;t have to edit it anymore whenever I have to use it. I also do not put any specific rule such as borders, background colors and those that depends on the look and feel of the site.</p>
<p>What do you do to make your coding easier?</p>
]]></content:encoded>
			<wfw:commentRss>http://tech-hive.com/front-end/css/being-productive-with-css-20070611/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
