<?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>arisyi-design.web.id &#187; CSS</title>
	<atom:link href="http://www.arisyi-design.web.id/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.arisyi-design.web.id</link>
	<description>WebDeveloper :: Internet business consultation, web design, web &#38; database programming services, Internet marketing and web maintenance</description>
	<lastBuildDate>Fri, 11 Jun 2010 04:02:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Multiple Class / ID and Class Selectors</title>
		<link>http://www.arisyi-design.web.id/css/multiple-class-id-and-class-selectors/</link>
		<comments>http://www.arisyi-design.web.id/css/multiple-class-id-and-class-selectors/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 16:06:27 +0000</pubDate>
		<dc:creator>azimah</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.arisyi-design.web.id/?p=260</guid>
		<description><![CDATA[Can you spot the difference between these two selectors?
#header.callout {  }
#header .callout { }

They look nearly identical, but the top one has no space between “#header” and “.callout” while the bottom one does. This small difference makes a huge difference in what it does. To some of you, that top selector may seem like [...]]]></description>
			<content:encoded><![CDATA[<p>Can you spot the difference between these two selectors?</p>
<pre><code class="css">#header.callout {  }
#header .callout { }</code></pre>
<p><span id="more-260"></span><br />
They look nearly identical, but the top one has no space between “#header” and “.callout” while the bottom one does. This small difference makes a huge difference in what it does. To some of you, that top selector may seem like a mistake, but it’s actually a quite useful selector. Let’s see the difference, what that top selector means, and exploring more of that style selector.</p>
<p><span id="more-5690"> </span></p>
<p>Here is the “plain English” of “#header .callout”:</p>
<blockquote><p>Select all elements with the class name <em>callout</em> that are children of the element with an ID of <em>header</em>.</p></blockquote>
<p>Here is the “plain English” of “#header.callout”:</p>
<blockquote><p>Select the element which has an ID of <em>header</em> and also a class name of <em>callout</em>.</p></blockquote>
<p>Maybe this graphic will make that more clear:</p>
<p><img src="http://css-tricks.com/wp-content/classplusid.png" alt="" width="570" height="190" /></p>
<h3>Combinations of Classes and IDs</h3>
<p>The big point here is that you can target elements that have combinations of classes and IDs by stringing those selectors together without spaces.</p>
<h4>ID and Class Selector</h4>
<p>As we covered above, you can target elements by a combination of ID and class.</p>
<pre><code class="html">&lt;h1 id="one" class="two"&gt;This Should Be Red&lt;/h1&gt;</code></pre>
<pre><code class="css">#one.two { color: red; }</code></pre>
<h4>Double Class Selector</h4>
<p>Target an element that has all of multiple classes. Shown below with two classes, but not limited to two.</p>
<pre><code class="html">&lt;h1 class="three four"&gt;Double Class&lt;/h1&gt;</code></pre>
<pre><code class="css">.three.four { color: red; }</code></pre>
<h4>Multiples</h4>
<p>We aren’t limited to only two here, we can combine as many classes and IDs into a single selector as we want.</p>
<pre><code class="css">.snippet#header.code.red { color: red; }</code></pre>
<p>Although bear in mind that’s getting a little ridiculous =)</p>
<h3>Example</h3>
<p>So how useful is all this really? Especially with ID’s, they are supposed to be unique anyway, so why would you need to combine it with a class? I admit the use cases for the ID versions are slimmer, but there are certainly uses. One of those is overriding styles easily.</p>
<pre><code class="css">#header { color: red; }
#header.override { color: black; } </code></pre>
<p>The second targets the same element, but overrides the color, instead of having to use:</p>
<pre><code class="css">.override { color: black !important }</code></pre>
<p>or perhaps prefacing the selector with something even more specific.</p>
<p>More useful is multiple classes and using them in the “object oriented” css style that is all the rage lately. Let’s say you had a bunch of divs on a page, and you used multiple various descriptive class names on them:</p>
<pre><code class="html">&lt;div class="red border box"&gt;&lt;/div&gt;
&lt;div class="blue border box"&gt;&lt;/div&gt;
&lt;div class="green border box"&gt;&lt;/div&gt;
&lt;div class="red box"&gt;&lt;/div&gt;
&lt;div class="blue box"&gt;&lt;/div&gt;
&lt;div class="green box"&gt;&lt;/div&gt;
&lt;div class="border box"&gt;&lt;/div&gt;</code></pre>
<p>They all share the class “box”, which perhaps sets a width or a background texture, something that all of them have in common. Then some of them have color names as classes, this would be for controlling the colors used inside the box. Perhaps green means the box has a greenish background and light green text. A few of them have a class name of “border”, presumably these would have a border on them while the rest would not.</p>
<p>So let’s set something up:</p>
<pre><code class="css">.box { width: 100px; float: left; margin: 0 10px 10px 0; }
.red { color: red; background: pink; }
.blue { color: blue; background: light-blue; }
.green { color: green; background: light-green; }
.border { border: 5px solid black; }</code></pre>
<p>Cool, we have a good toolbox going here, where we can create new boxes and we have a variety of options, we can pick a color and if it has a border or not just by applying some fairly semantic classes. Having this class name toolbox also allows us to target unique combinations of these classes. For example, maybe that black border isn’t working on the red boxes, let’s fix that:</p>
<pre><code class="css">.red.border { border-color: #900; }</code></pre>
<div class="image-wrap"><img src="http://css-tricks.com/wp-content/csstricks-uploads/boxes.png" alt="" width="450" height="151" /><br />
Border color on red box changed because it had both the red class and border class</div>
<p>Based on <a href="http://css-tricks.com/examples/MultipleClasses/">this demo page</a>.</p>
<h3>Browser Compatibility</h3>
<p>All good current browsers support this as well as IE back to version 7. IE 6 is rather weird. It selects based on the first selector in the list. So “.red.border” will select based on just “.red”, which kinda ruins things. But if you are supporting IE 6, you are used to this kind of tomfoolery anyway and can just fix it with conditional styles.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arisyi-design.web.id/css/multiple-class-id-and-class-selectors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE CSS Bugs That’ll Get You Every Time</title>
		<link>http://www.arisyi-design.web.id/css/ie-css-bugs-that%e2%80%99ll-get-you-every-time/</link>
		<comments>http://www.arisyi-design.web.id/css/ie-css-bugs-that%e2%80%99ll-get-you-every-time/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 05:03:59 +0000</pubDate>
		<dc:creator>azimah</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[IE bug]]></category>

		<guid isPermaLink="false">http://www.arisyi-design.web.id/?p=253</guid>
		<description><![CDATA[
IE 6 actually had the best CSS support of any browser when it first came out… SEVEN YEARS AGO. The little bugs in it’s CSS support still haunt us to this day. I still get comments from people who roundly reject any technique that doesn’t work in IE 6. While I generally refuse to pander [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://css-tricks.com/wp-content/uploads/2008/04/ie-bug.jpg" alt="ie-bug"></p>
<p>IE 6 actually had the best CSS support of any browser when it first came out… SEVEN YEARS AGO. The little bugs in it’s CSS support still haunt us to this day. I still get comments from people who <a href="http://css-tricks.com/improved-current-field-highlighting-in-forms/#comment-14999">roundly reject any technique</a> that doesn’t work in IE 6. While I generally refuse to pander to IE 6’s limitations, I still feel it is important to make things look right in it whenever possible. Here are that major bugs in IE that’ll get you every time:<br /> <span id="more-482"></span></p>
<h3>The Box Model</h3>
<p>This is perhaps the most common and frustrating bug of all in IE 6 and below. Let’s say you declare a box like this:</p>
<pre><code>div#box {
   width: 100px;
   border: 2px solid black;
   padding: 10px;
}</code></pre>
<p><span id="more-253"></span>
<p>IE 6 will calculate the width of the box to be <strong>100px.</strong><br /> Modern browsers will calculate the width of the box to be <strong>124px</strong>.</p>
<p>This kind of discrepancy can cause HUGE layout problems. I even think the IE version makes a little bit more sense logically, but that is not how the spec was written. IE 6 can actually get it right <strong>if you are in standards-compliant mode</strong>, which is rare these days as just using an HTML 4.0 transitional doctype will trigger quirks mode and the box model problem.</p>
<p>I generally work around this issue by just not using padding on boxes I am using for layout. If that box has some text inside it in a &lt;p&gt; element, I’ll apply the padding it needs directly to that p element. Just side-steps the issue, but it works.</p>
<p>&nbsp;</p>
<h3>The Double Margin Bug</h3>
<p>Using our box example from above, let’s say we need that floated to the right:</p>
<pre><code>div#box {
   float: right;
   margin-right: 20px;
}</code></pre>
<p>IE 6 will <strong>double the 20px to 40px</strong>. Again, causing potentially huge layout borks. The commonly thrown-around “fix” for this is to add “display: inline;” to the div. I’m not sure how this “fix” got so much traction, but its a bit impractical. We can’t set static widths on inline elements, now can we?</p>
<p>I also like to side-step this bug whenever possible. If you really need to push that box away from the right side of it’s parent element, you can likely do so by adding padding to the parent element, which is more likely to keep your grid consistent anyway. Also don’t forget about padding. This bug does not affect padding, so you can offen get away with adding padding to the side you need an achieve the same result.</p>
<p>&nbsp;</p>
<h3>No Min Widths / Min Height</h3>
<p>Setting min-width and min-height on elements is such a natural and logical thing that it makes me tear up sometimes thinking I can’t count on them. IE 6 doesn’t just get it wrong, it just completely ignores them. Min-height is incredibly useful for something like a footer. Say your footer needs to be <em>at least </em>100px tall because you are using a background image down there, but you don’t want to set a static height because you want it to grow nicely if, say, the text size is bumped up significantly. Min-height is perfect for this, but using it alone will get you no height whatsoever from IE 6. In a bizarre twist of luck, IE 6 treats the regular height property like modern browsers treat min-height, so you can use a “<a href="http://www.dustindiaz.com/min-height-fast-hack/">hack</a>” to fix it. I call it a “hack”, because I don’t really consider it a hack since it validates just fine.</p>
<p>&nbsp;</p>
<h3>Stepdown</h3>
<p>Normally when floating objects you can count on them lining up vertically until they break. That is, you could if you weren’t using IE 6. IE 6 appends a line break effect after each floated block element which will cause “stepdown”. The fix here is to make sure the line-height in the parent element is set to zero (0), or that the elements being floated are inline elements.  More on <a href="http://css-tricks.com/prevent-menu-stepdown/">preventing stepdown here</a>.</p>
<p>&nbsp;</p>
<h3>No Hover States</h3>
<p>Most modern browsers support hover states on just about any element, but not IE 6. IE 6 only support the hover pseudo-class on anchor (&lt;a&gt;) elements, and <em>even then</em> you don’t get them if your anchor doesn’t have a href attribute. The solution here is to use a <a href="http://www.xs4all.nl/%7Epeterned/csshover.html">proprietary fix</a>, or just deal with not having hover states on everything you want.</p>
<p>&nbsp;</p>
<h3>No Alpha Transparent PNG Support</h3>
<p><span class="crossout">Kind of funny that Microsoft themselves developed the PNG format, but their own browser doesn’t natively support it (until IE 7)</span>*. I have a whole <a href="http://css-tricks.com/the-different-techniques-for-applying-the-png-hack/">roundup of different fixes</a> for this. Do remember that regular non-alpha transparent PNG files work fine without any fix in IE 6, and are often better than their GIF sisters.</p>
<p>*<strong>Update</strong>: I was totally wrong about the Microsoft thing, no idea how that got in my head. <a href="http://www.libpng.org/pub/png/pnghist.html">Tom Boutell</a> actually developed the PNG format. Thanks all!</p>
<p>&nbsp;</p>
<h3>So…</h3>
<p>All these bugs are either fixable or side-steppable, but they will get ya if you don’t do your testing. My general philosophy is: design with the most modern techniques possible, but then just make sure it ain’t busted in older ones.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arisyi-design.web.id/css/ie-css-bugs-that%e2%80%99ll-get-you-every-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Create an IE-Only Stylesheet</title>
		<link>http://www.arisyi-design.web.id/css/how-to-create-an-ie-only-stylesheet/</link>
		<comments>http://www.arisyi-design.web.id/css/how-to-create-an-ie-only-stylesheet/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 04:51:02 +0000</pubDate>
		<dc:creator>azimah</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[IE bug]]></category>
		<category><![CDATA[IE only]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[IE7]]></category>

		<guid isPermaLink="false">http://www.arisyi-design.web.id/?p=249</guid>
		<description><![CDATA[
This article has been updated from an older version (originally Sept 24, 2007). I just wanted to expand it and make it more clear.
If you read this blog, there is a 99% chance you’ve had a hair-pulling experience with IE. But if you are worth your salt as a CSS coder, you should be able [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://css-tricks.com/wp-content/uploads/2007/09/ie-only-css.gif"/></p>
<p><strong>This article has been updated from an older version (originally Sept 24, 2007). I just wanted to expand it and make it more clear.</strong></p>
<p>If you read this blog, there is a 99% chance you’ve had a hair-pulling experience with IE. But if you are worth your salt as a CSS coder, you should be able to deal with it. I am of the opinion that you can handle anything IE can throw at you without the use of hacks. Hacks are dangerous, since they are based on non-standard exploits, you can’t predict how they are going to behave in future browsers. The tool of choice for fighting IE problems is the <strong>conditional stylesheet</strong>. IE provides comment tags, supported all the way up to the current IE 8 to target specific versions, as well as greater-than/less-than stuff for targeting multiple versions at once.</p>
<p><span id="more-132"></span></p>
<p><span id="more-249"></span><br />
<h2>Why use conditional stylesheets?</h2>
<ul>
<li>You got problems, they need fixin’</li>
<li>Keeps your code hack-free and valid</li>
<li>Keeps your main stylesheet clean</li>
<li>Perfectly acceptable technique, sanctioned by Microsoft</li>
</ul>
<p>And remember, these conditional tags don’t have to be used only for CSS. You could load JavaScript, or even use them down in the content of your site to display special IE-specific messages.</p>
<h2>The Code</h2>
<p>This would go in your &lt;head&gt; with all the other regular CSS &lt;link&gt;ed CSS files. The opening and closing tags should be familiar, that’s just regular ol’ <a href="http://css-tricks.com/snippets/html/comments-in-html/">HTML comments</a>. Then between the brackets, “IF” and “IE” should be fairly obvious. The syntax to note is “!” stand for “not”, so !IE means “not IE”. <tt>gt</tt> means “greater than”, <tt>gte</tt> means “greater than or equal”, <tt>lt</tt> means “less than”, <tt>lte</tt> means “less than or equal.”</p>
<h4>Target ALL VERSIONS of IE</h4>
<pre><code>&lt;!--[if IE]&gt;
	&lt;link rel="stylesheet" type="text/css" href="all-ie-only.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<h4>Target everything EXCEPT IE</h4>
<pre><code>&lt;!--[if !IE]&gt;
	&lt;link rel="stylesheet" type="text/css" href="not-ie.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<h4>Target IE 7 ONLY</h4>
<pre><code>&lt;!--[if IE 7]&gt;
	&lt;link rel="stylesheet" type="text/css" href="ie7.css"&gt;
&lt;![endif]--&gt;</code></pre>
<h4>Target IE 6 ONLY</h4>
<pre><code>&lt;!--[if IE 6]&gt;
	&lt;link rel="stylesheet" type="text/css" href="ie6.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<h4>Target IE 5 ONLY</h4>
<pre><code>&lt;!--[if IE 5]&gt;
	&lt;link rel="stylesheet" type="text/css" href="ie5.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<h4>Target IE 5.5 ONLY</h4>
<pre><code>&lt;!--[if IE 5.5000]&gt;
&lt;link rel="stylesheet" type="text/css" href="ie55.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<h4>Target IE 6 and LOWER</h4>
<pre><code>&lt;!--[if lt IE 7]&gt;
	&lt;link rel="stylesheet" type="text/css" href="ie6-and-down.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<pre><code>&lt;!--[if lte IE 6]&gt;
	&lt;link rel="stylesheet" type="text/css" href="ie6-and-down.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<h4>Target IE 7 and LOWER</h4>
<pre><code>&lt;!--[if lt IE 8]&gt;
	&lt;link rel="stylesheet" type="text/css" href="ie7-and-down.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<pre><code>&lt;!--[if lte IE 7]&gt;
	&lt;link rel="stylesheet" type="text/css" href="ie7-and-down.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<h4>Target IE 8 and LOWER</h4>
<pre><code>&lt;!--[if lt IE 9]&gt;
	&lt;link rel="stylesheet" type="text/css" href="ie8-and-down.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<pre><code>&lt;!--[if lte IE 8]&gt;
	&lt;link rel="stylesheet" type="text/css" href="ie8-and-down.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<h4>Target IE 6 and HIGHER</h4>
<pre><code>&lt;!--[if gt IE 5.5]&gt;
	&lt;link rel="stylesheet" type="text/css" href="ie6-and-up.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<pre><code>&lt;!--[if gte IE 6]&gt;
	&lt;link rel="stylesheet" type="text/css" href="ie6-and-up.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<h4>Target IE 7 and HIGHER</h4>
<pre><code>&lt;!--[if gt IE 6]&gt;
	&lt;link rel="stylesheet" type="text/css" href="ie7-and-up.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<pre><code>&lt;!--[if gte IE 7]&gt;
	&lt;link rel="stylesheet" type="text/css" href="ie7-and-up.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<h4>Target IE 8 and HIGHER</h4>
<pre><code>&lt;!--[if gt IE 7]&gt;
	&lt;link rel="stylesheet" type="text/css" href="ie8-and-up.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<pre><code>&lt;!--[if gte IE 8]&gt;
	&lt;link rel="stylesheet" type="text/css" href="ie8-and-up.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<h2>Universal IE 6 CSS</h2>
<p>Dealing with IE 6 and below is always an extra-special challenge. These days people are dropping support for it right and left, including major businesses, major web apps, and even governments. There is a better solution than just letting the site go to hell, and that is to server IE 6 and below a special stripped-down stylesheet, and then serve IE 7 and above (and all other browsers) the regular CSS. This is been coined the <a href="http://css-tricks.com/snippets/html/universal-ie6-css/">universal IE 6 CSS</a>.</p>
<pre><code class="html">&lt;!--[if !IE 6]&gt;&lt;!--&gt;
  &lt;link rel="stylesheet" type="text/css" media="screen, projection" href="REGULAR-STYLESHEET.css" /&gt;
&lt;!--&lt;![endif]--&gt;
&lt;!--[if gte IE 7]&gt;
  &lt;link rel="stylesheet" type="text/css" media="screen, projection" href="REGULAR-STYLESHEET.css" /&gt;
&lt;![endif]--&gt;
&lt;!--[if lte IE 6]&gt;
  &lt;link rel="stylesheet" type="text/css" media="screen, projection" href="http://universal-ie6-css.googlecode.com/files/ie6.0.3.css" /&gt;
&lt;![endif]--&gt;</code></pre>
<h2>Hacks</h2>
<p>If you must…</p>
<h4>IE-7 ONLY</h4>
<pre><code>* html #div {
    height: 300px;
}</code></pre>
<h4>NON IE-7 ONLY:</h4>
<pre><code>#div {
   _height: 300px;
}</code></pre>
<h4>Hide from IE 6 and LOWER:</h4>
<pre><code>#div {
   height/**/: 300px;
}</code></pre>
<pre><code>html &gt; body #div {
      height: 300px;
}</code></pre>
<h2>Argument against conditional stylesheets</h2>
<p>We shouldn’t need them. They are against the spirit of web standards.</p>
<h2>Argument for conditional stylesheets</h2>
<p>Yeah, but we do need them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arisyi-design.web.id/css/how-to-create-an-ie-only-stylesheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE Background RGB Bug</title>
		<link>http://www.arisyi-design.web.id/css/ie-background-rgb-bug/</link>
		<comments>http://www.arisyi-design.web.id/css/ie-background-rgb-bug/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 04:28:18 +0000</pubDate>
		<dc:creator>azimah</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[IE Background RGB Bug]]></category>
		<category><![CDATA[IE bug]]></category>

		<guid isPermaLink="false">http://www.arisyi-design.web.id/?p=244</guid>
		<description><![CDATA[Using RGBa for progressive enhancement is getting more and more popular, which is awesome. Even nearly a year ago it was pretty much ready to rock. A great way to handle the progressive enhancement part is just to declare a fallback color before the RGBa value, so older browsers that don’t support it will get [...]]]></description>
			<content:encoded><![CDATA[<p>Using RGBa for progressive enhancement is getting more and more popular, which is awesome. Even nearly a year ago it was pretty much ready to rock. A great way to handle the progressive enhancement part is just to declare a fallback color before the RGBa value, so older browsers that don’t support it will get a solid color version:</p>
<pre class="css">
<span class="cssSelector">div {</span>
   <span class="cssProperty">background</span><span class="cssRest">:</span><span class="cssValue"> rgb(200, 54, 54)</span><span class="cssRest">;</span> <span class="cssComment">/* The Fallback */</span>
   <span class="cssProperty">background</span><span class="cssRest">:</span><span class="cssValue"> rgba(200, 54, 54, 0.5)</span><span class="cssRest">;</span>
<span class="cssSelector">}</span>
</pre>
<p>The situation is that the RGB fallback color only works when using shorthand. If you were to declare the fallback color like this:</p>
<pre class="css">
<span class="cssSelector">div {</span>
	<span class="cssProperty">background-color</span><span class="cssRest">:</span><span class="cssValue"> rgb(255,0,0)</span><span class="cssRest">;</span>
	<span class="cssProperty">background-color</span><span class="cssRest">:</span><span class="cssValue"> rgba(255,0,0,0.5)</span><span class="cssRest">;</span>
<span class="cssSelector">}</span>
</pre>
<p>Using the background-color property only, it will fail and display no background color at all.</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/iergbbug.png" border="1" /></p>
<h2>Solution</h2>
<p>Using RGB for a fallback is nice. It’s no-brainer work because all you have to do is duplicated the RGBa value, remove the “a” and remove the 4th (opacity) parameter. If you want to keep using RGB as a fallback, just remember to set it using shorthand (if possible), or set the fallback using regular HEX codes or keywords.</p>
<p>In <a href="http://css-tricks.com/examples/IERGBBug/">the example</a>, the result of 50% red is a light red anyway, so using a hex code to specify that value might be a more appropriate fallback color anyway.</p>
<pre class="css">
<span class="cssSelector">div {</span>
  <span class="cssProperty">background-color</span><span class="cssRest">:</span><span class="cssValue"> #fd7e7e</span><span class="cssRest">;</span>
  <span class="cssProperty">background-color</span><span class="cssRest">:</span><span class="cssValue"> rgba(255,0,0,0.5)</span><span class="cssRest">;</span>
<span class="cssSelector">}</span>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.arisyi-design.web.id/css/ie-background-rgb-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Target IE6 and IE7 with Only Two Characters</title>
		<link>http://www.arisyi-design.web.id/css/how-to-target-ie6-and-ie7-with-only-two-characters/</link>
		<comments>http://www.arisyi-design.web.id/css/how-to-target-ie6-and-ie7-with-only-two-characters/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 07:32:32 +0000</pubDate>
		<dc:creator>azimah</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css hack]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[IE7]]></category>

		<guid isPermaLink="false">http://www.arisyi-design.web.id/?p=220</guid>
		<description><![CDATA[Did you know that, with the addition of only two characters, you can target both Internet Explorer 6 and 7 in your stylesheets? It&#8217;s easy&#8230;I&#8217;ll show you!

 #someElement {
    background: red; /* modern browsers */
   *background: green; /* IE 7 and below */
   _background: yellow; /* IE6 exclusively [...]]]></description>
			<content:encoded><![CDATA[<p>Did you know that, with the addition of only two characters, you can target both Internet Explorer 6 and 7 in your stylesheets? It&#8217;s easy&#8230;I&#8217;ll show you!</p>
<pre class="css">
 <span class="cssSelector">#someElement {</span>
    <span class="cssProperty">background</span><span class="cssRest">:</span><span class="cssValue"> red</span><span class="cssRest">;</span> <span class="cssComment">/* modern browsers */</span>
   *<span class="cssProperty">background</span><span class="cssRest">:</span><span class="cssValue"> green</span><span class="cssRest">;</span> <span class="cssComment">/* IE 7 and below */</span>
   _<span class="cssProperty">background</span><span class="cssRest">:</span><span class="cssValue"> yellow</span><span class="cssRest">;</span> <span class="cssComment">/* IE6 exclusively */</span>
<span class="cssSelector">}</span>  </pre>
]]></content:encoded>
			<wfw:commentRss>http://www.arisyi-design.web.id/css/how-to-target-ie6-and-ie7-with-only-two-characters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

