<?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>Advanced CSS Design Resources - last-child.com &#187; Hacks</title>
	<atom:link href="http://www.last-child.com/category/css/hacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.last-child.com</link>
	<description>CSS Toys for Professional Web Developers</description>
	<lastBuildDate>Thu, 08 Jul 2010 16:59:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Progressive enhancement of links using the CSS attribute selector</title>
		<link>http://www.last-child.com/css-attribute-selector/</link>
		<comments>http://www.last-child.com/css-attribute-selector/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 20:13:00 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[:after]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS2]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[DHTML]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[IE8]]></category>
		<category><![CDATA[Image Sprites]]></category>
		<category><![CDATA[Link]]></category>
		<category><![CDATA[Online Resource]]></category>
		<category><![CDATA[W3C]]></category>
		<category><![CDATA[attribute selector]]></category>
		<category><![CDATA[min-height]]></category>
		<category><![CDATA[attribute]]></category>
		<category><![CDATA[selector]]></category>

		<guid isPermaLink="false">http://www.last-child.com/?p=152</guid>
		<description><![CDATA[Attribute Selector Test Page We have avoided using CSS3 rules for too long. It&#8217;s been difficult to justify using rules that won&#8217;t work for a significant portion of our audience, Internet Explorer 7 and below. However, Internet Explorer 8 is coming out soon and does work with the features we like. I think it&#8217;s fairly [...]]]></description>
			<content:encoded><![CDATA[<p><a href="/examples/attrib-files/index.html">Attribute Selector Test Page </a></p>
<p>
We have avoided using CSS3 rules for too long. It&#8217;s been difficult to justify using rules that won&#8217;t work for a significant portion of our audience, Internet Explorer 7 and below.  However, Internet Explorer 8 is coming out soon and does work with the features we like. </p>
<p>
 I think it&#8217;s fairly safe to assume IE7 users will upgrade to IE8 within a short time. Those stuck with IE6 for one reason or another will slowly disappear as they are given new computers or their locked down environments are upgraded.</p>
<p>
So, with the future of CSS3 functionality within reach, I&#8217;ve been energized to begin experimenting again.  I&#8217;ll be writing a series of blog posts over the next few months that look at CSS3 functionality as a progressive enhancement. How can we continue to deliver a perfectly fine web site to IE6 and IE7 and mobile phones while enhancing the functionality of more modern browsers and devices?</p>
<h3>Attribute Selectors</h3>
<p>
CSS attribute selectors are the golden ring on the web development merry-go-round. They can be daunting to learn, addictive to use, but then disappointing when you realize they are out of your grasp when you test in Internet Explorer.  We can, however, begin using them to add additional functionality based on your pre-existing, semantic code. Attribute selectors give you power to write CSS that pinpoints the stuff you already code, without having to go back and add classes or ids. I&#8217;ve written previously about <a href="/attribute-selectors-to-provide-language-information/">using attribute selectors to let your users know the language of a site they are about to visit</a>. This trick relies on the rarely used hreflang attribute, which identifies the language of the site targeted in a link.</p>
<p>
There are many other attributes in your HTML, from <a href="http://www.w3.org/TR/html4/struct/tables.html#h-11.4.1">table headers</a>, <a href="http://www.w3.org/TR/REC-html40/struct/objects.html#adef-src-IMG">image src</a>,  <a href="http://www.w3.org/TR/html401/struct/links.html#h-12.1.4">link titles</a>, and <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.6.1">selected options</a>. Think about all of those juicy attributes just waiting to be targeted. Also think about how you could actually do something useful with them.</p>
<h3>Announce the file type of a link with CSS</h3>
<p>
I once worked for a company that had hundreds of thousands of static HTML pages in their intranet. With no content management system; it was impossible to make global changes. The only thing they shared was a common set of style sheets. Does this sound familiar?  Follow along as we increase your site&#8217;s usability in a less than perfect, but efficient way. </p>
<p>
First off, for accessibility, you need to let users know when a link  will open a file, what type it is, and how large it is. This is best done by adding it to your HTML code:</p>
<p><code lang="HTML"><br />
<a href="foo.pdf" class="pdf">Foo presentation (.pdf, 5kb)</a><br />
</code></p>
<p>That delivers the information to everyone, regardless of their browser.  This, however takes time and is a daunting task for updating legacy code. </p>
<p>
We can, however, use the <a href="http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#attribute-selectors">atttribute selector</a> to target the extension of the link to display the icon and insert the text describing the file type. Here&#8217;s the sample HTML code:</p>
<p><code lang="HTML"></p>
<ul>
<li><a href="foo.zip" >sample zip link</a></li>
<li><a href="foo.pdf" >sample pdf link</a></li>
<li><a href="foo.doc" >sample Word link</a></li>
<li><a href="foo.exe" >sample Executable link</a></li>
<li><a href="foo.png" >sample png image</a></li>
<li><a href="foo.mp3" >sample MP3 file </a></li>
</ul>
<p></code><br />
It&#8217;s a simple list of links for different types of files. We&#8217;ll be looking at the extensions: .zip, .pdf, .doc, .exe, .png, and .mp3. Feel free to extend this list to any extension you so desire. This would be especially helpful for a company that uses proprietary file types within their intranet.</p>
<p>
Now, let&#8217;s look at the CSS:</p>
<p><code lang="CSS"><br />
a[href$="zip"],<br />
a[href$="pdf"],<br />
a[href$="doc"],<br />
a[href$="exe"],<br />
a[href$="png"],<br />
a[href$="mp3"]  {padding-left:20px; background:url(bg-file-icons.png) no-repeat 0 0;}<br />
a[href$="png"]{background-position: 0 -48px;}<br />
a[href$="pdf"] {background-position: 0 -99px;}<br />
a[href$="mp3"]{background-position: 0 -145px;}<br />
a[href$="doc"]{background-position: 0 -199px;}<br />
a[href$="exe"]{background-position: 0 -250px;}</p>
<p>a[href$=".zip"]:after{content: "(.zip file)"; color:#999; margin-left:5px;}<br />
a[href$=".pdf"]:after{content: "(.pdf file)"; color:#999; margin-left:5px;}<br />
a[href$=".doc"]:after{content: "(.doc file)"; color:#999; margin-left:5px;}<br />
a[href$=".exe"]:after{content: "(.exe file)"; color:#999; margin-left:5px;}<br />
a[href$=".mp3"]:after{content: "(.mp3 file)"; color:#999; margin-left:5px;}<br />
a[href$=".png"]:after{content: "(.png file)"; color:#999; margin-left:5px;}<br />
a[href$=".exe"]:after{content: "(.exe file)"; color:#999; margin-left:5px;}<br />
</code></p>
<p><a href="/examples/attrib-files/index.html">See the final test page.</a></p>
<h4>Pattern matching in the attribute selector</h4>
<p>We have some limited &#8220;regular expression&#8221; functionality in CSS3. We can search for an attribute&#8217;s presence and match a pattern within the attribute&#8217;s value.<br />
<a href="http://www.hunlock.com/">Patrick Hunlon</a> has a good summary of the pattern matching: </p>
<blockquote cite="http://www.hunlock.com/blogs/Attach_icons_to_anything_with_CSS">
<ul>
<li>[foo]        &#8212; Has an attribute named &#8220;foo&#8221;</li>
<li>[foo="bar"]  &#8212; Has an attribute named &#8220;foo&#8221; with a value of &#8220;bar&#8221; (&#8220;bar&#8221;)</li>
<li>[foo~="bar"] &#8212; Value has the word &#8220;bar&#8221; in it somewhere (&#8220;blue bar stools&#8221;)</li>
<li>[foo^="bar"] &#8212; Value begins with &#8220;bar&#8221; (&#8220;barstool&#8221;)</li>
<li>[foo$="bar"] &#8212; Value ends with &#8220;bar&#8221; (&#8220;I was at the bar&#8221;)</li>
<li>[foo*="bar"] &#8212; Value has bar somewhere (&#8220;I was looking for barstools&#8221;)  </li>
</ul>
<p><cite><a href="http://www.hunlock.com/blogs/Attach_icons_to_anything_with_CSS">Attach icons to anything with CSS</a></cite>
</p></blockquote>
<p>
The CSS is simply looking to see if the desired extension is at the end of the link href. If so, apply the following styles. </p>
<h4>Adding an icon to the link</h4>
<p>First, we are match any of the desired file extensions.  We then add a background image and some padding on the left side with a bulk rule. Then  the background position on the sprite is adjust for each particular link type. Combining multiple icons into one background image reduces the number of files the user has to download, <a href="http://developer.yahoo.com/performance/rules.html#opt_sprites">making your page faster</a>. This will work with any browser that recognizes attribute selectors, including Internet Explorer 7. However, support for more obscure attributes may be spotty.</p>
<p>
There&#8217;s another peculiarity with pattern matching. Some attributes are case sensitive while others are not. The href attribute is NOT case sensitive, so the above rules will also work if your image name was <em>FOO.ZIP</em>, <em>foo.Zip</em>, or <em>foo.zip</em>.</p>
<h4>Adding the descriptive text</h4>
<p>Now, we are going to add a bit of descriptive text to each link. We can&#8217;t describe the file size, but we can tell the user what type of file it is. This is using the :after(content:) functionality and is supported by Internet Explorer 8 (yeah!!!) but not Internet Explorer 7 and below (boo!!!).<br />
We will also adjust the color and give it a bit of spacing.</p>
<h3>A big step forward with a small chunk of work</h3>
<p>
There you have it. A small chunk of CSS coding has now added substantial usability to your legacy pages. While the CSS version is not as accessible as having the data in the actual link code, it&#8217;s a significant improvement over nothing at all. Further, there&#8217;s no harmful effect on browsers that do not understand the function. You&#8217;ve added information, but haven&#8217;t taken anything away. This is a win in my book. To save some time and effort, you could just download and use this  package of <a href="http://pooliestudios.com/projects/iconize/">CSS and icons</a> from <a href="http://pooliestudios.com">Alexander Kaiser</a>.</p>
<p>
This rather simple example of attribute selectors and pattern matching can open your eyes to many possibilities. There are a number of developers that have been expoloring this potential for the past few years. Take a look at some of these resources for more ideas and have some fun.</p>
<ul>
<li><a href="http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#attribute-selectors">CSS3 &#8211; Atribute Selectors Definition </a> W3C</li>
<li><a href="http://www.456bereastreet.com/archive/200601/css_3_selectors_explained/">CSS 3 Selectors Explained</a></li>
<li><a href="http://www.stuffandnonsense.co.uk/archives/css_a_tribute_to_selectors.html">CSS: A Tribute to Selectors</a></li>
<li><a href="http://developer.yahoo.com/yui/selector/">YUI: Selector Utility</a> Use CSS3 selectors in JavaScript</li>
<li><a href="http://www.cssdrive.com/index.php/forums/viewthread/45/">Dynamic File Type Notations </a></li>
<li><a href="http://www.andybudd.com/archives/2003/09/cool_use_for_css_attribute_selectors/">Cool use for CSS attribute selectors </a> &#8211; Hiding banner ads with CSS</li>
<li><a href="http://www.askthecssguy.com/2006/12/showing_hyperlink_cues_with_cs_1.html">Showing Hyperlink Cues with CSS </a></li>
<li><a href="http://www.askthecssguy.com/2006/12/showing_hyperlink_cues_with_cs_1.html">Showing Hyperlink Cues with CSS </a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/css-attribute-selector/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>IE7 and IE8 hack behavior</title>
		<link>http://www.last-child.com/ie7-and-ie8-hack-behavior/</link>
		<comments>http://www.last-child.com/ie7-and-ie8-hack-behavior/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 22:59:53 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[IE8]]></category>

		<guid isPermaLink="false">http://www.last-child.com/ie7-and-ie8-hack-behavior/</guid>
		<description><![CDATA[We&#8217;ve had the luxury of hacks to fine tune Internet Explorer bugs. Internet Explorer 7 disabled the majority of hacks, with the exception of the * hack. This hack allowed you to send a style only to Internet Explorer by prefacing an attribute with an asterisk. /*this is for all browsers*/ #main p {color:black;} /* [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve had the luxury of hacks to fine tune Internet Explorer bugs. Internet Explorer 7 disabled the majority of hacks, with the exception of the * hack. This hack allowed you to send a style only to Internet Explorer by prefacing an attribute with an asterisk.</p>
<p><code lang="CSS"><br />
/*this is for all browsers*/<br />
#main p {color:black;}<br />
/* this is for Internet Explorer */<br />
#main *p {color:red;}<br />
/*this is ignored by IE7 and will target IE6 */<br />
#main _p {color:green;}<br />
</code></p>
<p>This set of hacks allowed us to control IE7 and IE6. However, IE8 does not recognize the * hack. Special IE8 rules will either need to be defined with conditional comments, the Microsoft proposed meta tag, or some new hack to be discovered. Let&#8217;s hope the mature version of IE8 will reduce the need for these hacks. </p>
<p>For more information on the above hacks, visit an earlier post: <a href="http://www.last-child.com/ie7-hacks/">IE7 Hacks</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/ie7-and-ie8-hack-behavior/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Internet Explorer 8 beta released for testing</title>
		<link>http://www.last-child.com/internet-explorer-8-beta-released-for-testing/</link>
		<comments>http://www.last-child.com/internet-explorer-8-beta-released-for-testing/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 22:50:10 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[IE8]]></category>
		<category><![CDATA[Online Resource]]></category>
		<category><![CDATA[attribute selector]]></category>

		<guid isPermaLink="false">http://www.last-child.com/internet-explorer-8-beta-released-for-testing/</guid>
		<description><![CDATA[The MIX 2008 conference is this week and Microsoft is showing off some of their latest tools. One of these is the much anticipated and discussed Internet Explorer 8 browser. It&#8217;s important to remember that this is still a beta 1 release and is much better than the IE7 beta 1. This one actually has [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://visitmix.com/2008/default.aspx">MIX 2008 conference</a> is this week and Microsoft is showing off some of their latest tools. One of these is the much anticipated and discussed <a href="http://technorati.com/blogs/tag/Internet+Explorer+8">Internet Explorer 8</a> browser. It&#8217;s important to remember that this is still a beta 1 release and is much better than the IE7 beta 1. This one actually has significant changes.</p>
<h3>Download Internet Explorer 8</h3>
<p>You can download <a href="http://www.microsoft.com/windows/products/winfamily/ie/ie8/getitnow.mspx">Internet Explorer 8, Beta 1</a> from the Microsoft Developer site. However, here are a few things to keep in mind:</p>
<ol>
<li>This installation takes some time, about 15 minutes, and will require a restart of your computer.</li>
<li>It will replace your existing Internet Explorer and is not available as a stand-alone browser.</li>
<li>It renders in standards-mode as a default. You&#8217;ll see a button to render in IE7 mode. This is helpful to see the changes between the versions.</li>
<li>Many sites will have significant layout issues in the standard view. You may need to re-evaluate your conditional comments to specify <strong>IE7</strong> instead of <strong>greater than IE6</strong></li>
<li>IE8 is ignoring the * hack!  This means you can use the underscore hack for IE6, the * hack for IE6 and IE7 and &#8230; um&#8230; I don&#8217;t know yet for IE8. </li>
</ol>
<h3>Is IE8 better than IE7?</h3>
<ul>
<li>Internet Explorer 8 passes the <a href="http://www.webstandards.org/files/acid2/test.html#top">Acid2 Test</a>.  </li>
<li>It understands CSS attribute selectors and generated content.<br />
IE8 handles my <a href="http://www.last-child.com/attribute-selectors-to-provide-language-information/">international test page</a> fine. </li>
<li>It understands :hover on non-links but is still buggy. Here&#8217;s a good <a href="http://thomthom.net/storage/markup/html/sitenav/">test page with multiple CSS3 styles</a>.</li>
<li>It seems to have more integration with social platforms, maps, etc. Perhaps this is a nod towards <a href="http://flock.com">Flock</a>?</li>
</ul>
<p>It&#8217;s still really early to find all of the bugs and benefits of the new browser. The team needs to be commended for the fast development  and their willingness to listen to criticism and change the default behavior at such a late point. I look forward to the more mature releases.</p>
<h3>Updates</h3>
<ul>
<li>Leave it to <a href="http://blog.hedgerwow.com/">Hedger Wang</a> to find and document the first IE8 bug: <a href="http://blog.hedgerwow.com/2008/03/05/see-how-ie8-breaks/">See how IE8 breaks</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/internet-explorer-8-beta-released-for-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yahoo! Hack Day &#8211; Paxilled</title>
		<link>http://www.last-child.com/yahoo-hack-day-paxilled/</link>
		<comments>http://www.last-child.com/yahoo-hack-day-paxilled/#comments</comments>
		<pubDate>Mon, 26 Mar 2007 17:07:58 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Yahoo!]]></category>
		<category><![CDATA[paxilled]]></category>

		<guid isPermaLink="false">http://www.last-child.com/yahoo-hack-day-paxilled/</guid>
		<description><![CDATA[There&#8217;s a special buzz around the halls of Yahoo! today as Hack Day is about to begin. We have 24 hours to build, modify, or tweak the existing Yahoo! Technologies. We can also go outside the box and build new technologies. I have decided to go way, way, way outside the box with my hack. [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a special buzz around the halls of Yahoo! today as Hack Day is about to begin. We have 24 hours to build, modify, or tweak the existing Yahoo! Technologies. We can also go outside the box and build new technologies.</p>
<p><a href="http://www.flickr.com/photos/draket/80675646/" title="Photo Sharing"><img src="http://farm1.static.flickr.com/42/80675646_c2af428824_m.jpg" width="240" height="160" alt="Hundertwasser pathway in Vienna" /></a></p>
<p>I have decided to go way, way, way outside the box with my hack. I&#8217;m hacking the lexicon, the dictionary, the world of slang. I&#8217;m bypassing the world of code and trying to use the social network world to add a new word to our vocabulary.</p>
<dl>
<dt></dt>
<h3><a href="http://paxilled.com">Paxilled</a></h3>
<dd>Pronunciation: &#8216;paks-seld&#8217;</dd>
<dd>Function: adjective</dd>
<dd>
<ol id="definitions">
<li>Resembling the common side-effects of Paxil® medication: blurry, anxious, confused.
<dl>
<dt>Sample Uses</dt>
<dd>The new Tarantino film left me <strong>paxilled</strong></dd>
<dd>The site launched with a crowded, <strong>paxilled</strong> navigation menu</dd>
<dd>The lensbaby gives photos a <strong>paxilled</strong> effect</dd>
</dl>
</li>
<li>Medicated with Paxil.
<dl>
<dt>Sample Uses</dt>
<dd>Susan is happier with her <strong>paxilled</strong> hubby.</dd>
</dl>
</li>
</ol>
</dd>
<dd><strong>Uses</strong></p>
<ul>
<li>Flickr <a href="http://www.flickr.com/search/?q=paxilled&amp;w=all" title="images tagged with paxilled on flickr">Images</a> / <a href="http://www.flickr.com/groups/paxilled/">Paxilled Group</a></li>
<li><a href="http://www.technorati.com/search/paxilled">Technorati</a> <a href="http://del.icio.us/search/?fr=del_icio_us&#038;p=paxilled&#038;type=all">Del.icio.us</a> Results</li>
<li><a href="http://search.yahoo.com/search?p=paxilled&amp;ei=UTF-8&amp;fr=moz2">Yahoo Search results</a></li>
<li><a href="http://en.wikipedia.org/wiki/Paxilled">Wikipedia</a><ins>deleted 3/27/2007 by some paxilled editors</ins></li>
</ul>
</dd>
</dl>
<p>This hack is about the web&#8217;s social network capability. Consider this an invitation to use the word and publish it.</p>
<h3>Here’s what you can do: </h3>
<ul>
<li>
Visit <a href="http://www.paxilled.com">www.paxilled.com</a> for the full definition and links to progress results. </li>
<li>If you use <a href="http://flickr.com">Flickr</a> , add the tag “paxilled” to images that are… paxilled.  These could be images that are blurry, confused, hectic, anxious… The image could be perfectly normal but represent a paxilled person, place or thing. </li>
<li>Join the new Flickr photo group: <a href="http://www.flickr.com/groups/paxilled/">paxilled</a></li>
<li>
Use paxilled in a blog post and add the tag “paxilled”. Use paxilled in other types of publications.</li>
<li>Use paxilled in your daily conversation.  </li>
<li>Add paxilled to wikipedia, urban slang dictionary, or any other online resource center that you think may be appropriate.</li>
</ul>
<p>If you have something online, share it with a comment on this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/yahoo-hack-day-paxilled/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IE7 background sprite bug &#8211; the saga continues</title>
		<link>http://www.last-child.com/ie7-background-sprite-bug-the-saga-continues/</link>
		<comments>http://www.last-child.com/ie7-background-sprite-bug-the-saga-continues/#comments</comments>
		<pubDate>Thu, 08 Jun 2006 17:13:39 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[Image Sprites]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[position]]></category>

		<guid isPermaLink="false">http://www.last-child.com/ie7-background-sprite-bug-the-saga-continues/</guid>
		<description><![CDATA[I&#8217;ve been able to narrow down my problem with IE7b2 and background sprites. However, I still have not been able to create a stripped down test page that consistently mis-behaves. So my observations, while not scientific, could save you some hours of debugging. Internet Explorer 7beta2 is not treating transparent png background images correctly. It [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been able to narrow down <a href="http://www.last-child.com/ie7-measuring-sprites-from-bottom-up/">my problem with IE7b2 and background sprites</a>. However, I still have not been able to create a stripped down test page that consistently mis-behaves. So my observations, while not scientific, could save you some hours of debugging.</p>
<p>Internet Explorer 7beta2 is not treating transparent png background images correctly. It sees &#8220;background-position: 0 0&#8243; as &#8220;background-position: 0 100%&#8221;. Come to think of it, I have only tried a vertical sprite, this may be the same for a horizontal sprite. </p>
<h3>What&#8217;s the solution? </h3>
<p>You could create a series of rules in your IE7 style sheet to measure your new sprites from the bottom up, instead of top down. But this doesn&#8217;t solve some of the other odd issues with IE7 and transparent png images. I&#8217;ve seen the images load upside down and I&#8217;ve seen the images move when you scroll the page and the image hits the bottom of the browser. I thought I was going crazy or that I had some sort of mutated version. But this pseudo-animation works on other computers. </p>
<p>Our IE6 style sheet replaces our pretty alpha transparent png graphics with a simpler index transparent gif version. We replaced our re-measured rules in the IE7 with this set and it has solved our problems. It would be great to take advantage of IE7&#8242;s ability to use alpha transparent png images, but this bug is just driving me nuts.  I&#8217;ve also been in contact with the IE7 team. They are dedicated to building the best browser possible within their constraints and hopefully this will be figured out before the final launch of IE7. </p>
<p>One other note of advice. Creating alpha transparent png images via the save as command in Photoshop on a Mac gave us the worst results. Those images did some very funky things on the page. Fireworks created better images.</p>
<h3>c&#8217;est fini!</h3>
<p><del>I don&#8217;t know if it is official or not, but I can say that the Microsoft engineers are interested in what developers have to say and have worked on this bug. I believe it has been fixed and will be all good to go with the final release of IE7. I can&#8217;t confirm or deny this, but I am pleased with their response to my initial post and followup.</del><ins>This bug has officially been officially fixed as of Release Candidate 1 and you can use your transparent png sprites without a worry in the world!</ins></p>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/ie7-background-sprite-bug-the-saga-continues/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>IE7.css is at 146 lines and counting&#8230;</title>
		<link>http://www.last-child.com/ie7css-is-at-146-lines-and-counting/</link>
		<comments>http://www.last-child.com/ie7css-is-at-146-lines-and-counting/#comments</comments>
		<pubDate>Sat, 20 May 2006 00:08:19 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Conditional Comment]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[Quick Tips]]></category>

		<guid isPermaLink="false">http://www.last-child.com/ie7css-is-at-146-lines-and-counting/</guid>
		<description><![CDATA[How good is IE7? I was wondering about that today as I reloaded it to do another batch of bug fixing. The proof may be in your CSS pudding. We are using conditional comments to import either ie6.css or ie7.css to control our hacks. So far, the ie6 style sheet is 342 lines long, including [...]]]></description>
			<content:encoded><![CDATA[<p>How good is IE7? I was wondering about that today as I reloaded it to do another batch of bug fixing. The proof may be in your CSS pudding. </p>
<p>We are using <a href="http://www.456bereastreet.com/archive/200511/valid_downlevelrevealed_conditional_comments/">conditional comments </a>to import either ie6.css or ie7.css to control our hacks.<br />
<code lang="HTML"><br />
<! --[if IE 7]></p>
<link href="/css/ie7.css" type="text/css" rel="stylesheet" media="all"/>
<![endif]--><br />
<! --[if lte IE 6]></p>
<link href="/css/ie6.css" type="text/css" rel="stylesheet" media="all"/>
<![endif]-- ><br />
</code></p>
<p>So far, the ie6 style sheet is 342 lines long, including lots of whitespace and comments. A good portion of that is for re-assigning gif background images instead of png. The rest is an assortment of invoking <a href="http://rollyo.com/search.html?sourceid=Mozilla-search&#038;q=haslayout&#038;uid=4080&#038;sid=4886">hasLayout</a>, box model changes, and the ever-popular z-index bugs. </p>
<p>I copied this style sheet, commented everything out and began re-introducing the rules to build the IE7 style sheet. I ditched the gif and z-index hacks. The most common hacks are for <a href="http://rollyo.com/search.html?q=haslayout&#038;site=www.positioniseverything.net&#038;sid=4886">hasLayout</a> and double-margin float. I&#8217;m still using a set of hacks to re-configure my background images that are <a href="http://www.456bereastreet.com/archive/200511/valid_downlevelrevealed_conditional_comments/">being measured from the bottom up</a>.</p>
<p>So, how big is the IE7 style sheet? Right now, we are looking at 146 lines of code, including white space and comments.  That&#8217;s still a hefty amount and I&#8217;m not done fixing bugs.  Yes, IE7 is much better than IE6, but still a far cry from the others. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/ie7css-is-at-146-lines-and-counting/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IE7 measuring sprites from bottom up?</title>
		<link>http://www.last-child.com/ie7-measuring-sprites-from-bottom-up/</link>
		<comments>http://www.last-child.com/ie7-measuring-sprites-from-bottom-up/#comments</comments>
		<pubDate>Wed, 03 May 2006 00:24:08 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Conditional Comment]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[Image Sprites]]></category>
		<category><![CDATA[background]]></category>

		<guid isPermaLink="false">http://www.last-child.com/ie7-measuring-sprites-from-bottom-up/</guid>
		<description><![CDATA[I&#8217;m doing some IE7 hacking and was wondering what was going on with some of my sprites. They look fine in all of the browsers except IE7. For that lovely browser, I say with my teeth clinched, I&#8217;m getting really strange results. At first I thought it was a hasLayout issue, that I needed to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m doing some IE7 hacking and was wondering what was going on with some of my sprites. They look fine in all of the browsers except IE7. For that lovely browser, I say with my teeth clinched, I&#8217;m getting really strange results.  At first I thought it was a hasLayout issue, that I needed to do some messing around with the position:relative, or that it just didn&#8217;t like me.</p>
<p>However, while doing some troubleshooting, it looks like, <strong>please tell me I&#8217;m wrong</strong>, lE7 is measuring the sprite from the bottom up instead of the bottom down.</p>
<p>Here&#8217;s an example on <a href="http://tech.yahoo.com/pr/Apple-iMAC-G5-Desktop-Computer/1991804229">Yahoo! Tech</a>. You should see in the top product header 4 out of 5 blue stars for Pro Reviews and 5 out of 5 red stars for User Reviews. In IE7b, there are tiny nubbins from the tips of stars. </p>
<p><a href="http://us.tech5.yimg.com/tech.yahoo.com/images/20060430165459/bg-pro-ratings.png"> Here&#8217;s the background image (.png)</a> for the pro stars and the normal CSS for 4/5 stars:<br />
<code lang="CSS"><br />
.bigprostars4 span {width:100px; height:20px; top:0; background:url(/images/bg-pro-ratings.png) no-repeat 0 -50px;}<br />
</code></p>
<p>I began looking at the numbers, thinking they were off by a few pixels. After doing some testing of the positions, I realized that it was not measuring 50px down from the top, as other browsers handle sprites, but starting at the bottom of the image and measuring 50px up! Hence, displaying the tips of the small stars.</p>
<p>To fix this I added this style to the IE7.css (currently not live!) file:<br />
<code lang="CSS">.bigprostars4 span {width:100px; height:20px; top:0; background-position: 0 -400px;}</code></p>
<p>This is not a small issue. If you use sprites as extensively as I do, this involves opening every image and re-calculating the distance from the bottom up and inserting these numbers in an IE7 only style sheet.  Please, please tell me that I need to get another cup of coffee and I&#8217;m just dreaming this.   </p>
<h3>Update (05-02): Is this a position:absolute issue in IE7?</h3>
<p>I&#8217;m still seeing this bizarre activity in the sprites of absolutely positioned elements. The sprites of links and other objects that are not positioned are working fine. sigh&#8230;</p>
<h3>Update: IE7 passes sprite test (05-07)</h3>
<p>I&#8217;ve created a test page to see if I could narrow down the issues with IE7 and sprites. I was surprised to find <a href="http://www.last-child.com/ie7-passes-the-sprite-test/">IE7 passed my initial tests</a>. It must be a unique combination of styles causing my problem. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/ie7-measuring-sprites-from-bottom-up/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hacking to fix for IE7</title>
		<link>http://www.last-child.com/hacking-to-fix-for-ie7/</link>
		<comments>http://www.last-child.com/hacking-to-fix-for-ie7/#comments</comments>
		<pubDate>Mon, 27 Mar 2006 01:23:17 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[:absolute]]></category>
		<category><![CDATA[:block]]></category>
		<category><![CDATA[:relative]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Conditional Comment]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[Image Sprites]]></category>
		<category><![CDATA[background]]></category>

		<guid isPermaLink="false">http://www.last-child.com/hacking-to-fix-for-ie7/</guid>
		<description><![CDATA[I&#8217;ve played around with IE7 for a while, but haven&#8217;t really started debugging with it until now. Fortunately, I&#8217;ve already set up the site to use conditional comments and deliver an IE6.css file and a separate IE7.css file. This has made it much easier to target the offending areas of the site. IE7 has had [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve played around with IE7 for a while, but haven&#8217;t really started debugging with it until now.  Fortunately, I&#8217;ve already set up the site to use conditional comments and deliver an IE6.css file and a separate IE7.css file. This has made it much easier to target the offending areas of the site.</p>
<p>IE7 has had a couple surprising problems for me.  I have a topnav section that completely disappeared. The container div only has <em>position:relative</em> and inside are a number of floated elements. This actuall works great in all browsers&#8230; but IE7! <strong>No hacks for IE6, but hack for IE7!</strong> I went with the old adage, I think from <a href="http://www.andybudd.com/index.php">Andy Budd</a>, when all else fails float, if it&#8217;s already floated, unfloat.  I added <em>float:left </em> to the container div and the topnav re-appeared from the IE7 void.</p>
<h3>Munged Background Images</h3>
<p>I&#8217;m using a series of positioning,  text-indent, and background images on the site.  Here&#8217;s a simplified version:</p>
<p><code lang="CSS"><br />
.targetdl dd {position:relative;}<br />
.targetdl dd span {text-indent:-1000em; width:66px; display:block;  position:absolute; top:5px; right:20px;}<br />
.happy0 span {background:url(/images/happy0.png) no-repeat 0 -650px;}<br />
</code></p>
<p>IE7 shows the background image ok on some pages and on other pages, it shrinks the background image. I tried adding zoom:1 and font-size:100% to no avail. I&#8217;ll try line-height next.  This is an odd bug, but not the first time I noticed it on IE7 betas.  It certainly seems to be buggy with positioning. </p>
<h3>De-bugging Strategy</h3>
<p>Since I&#8217;ve already got a fairly solid ie6.css file, I&#8217;m going to use that as the basis of my IE7 CSS construction.  After fixing the topnav, the rest of the ie6.css file is going into the IE7 css and rules will be removed one at a time. This should help me figure out what is still needed.</p>
<p>I&#8217;ll keep notes on this site as I find it a convenient place to remember them. Has anyone else come across some positioning bugs in IE7? Sorry, no screen shots or details at this time, we&#8217;re still pre-alpha stage.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/hacking-to-fix-for-ie7/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hedger Wang is God! &#8211; well a guru at least.</title>
		<link>http://www.last-child.com/hedger-wang-is-god-well-a-guru-at-least/</link>
		<comments>http://www.last-child.com/hedger-wang-is-god-well-a-guru-at-least/#comments</comments>
		<pubDate>Tue, 14 Mar 2006 19:41:13 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Online Resource]]></category>
		<category><![CDATA[Quick Tips]]></category>

		<guid isPermaLink="false">http://www.last-child.com/hedger-wang-is-god-well-a-guru-at-least/</guid>
		<description><![CDATA[Hedger Wang responded to my desperate plea for help on the z-index issue with a simple test page on his blog with an ingenious iframe solution. How people imagine these solutions is simply beyond me. So, then I started going through his blog and was blown away by his tests and solutions. CSS, JS, AJAX, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.360.yahoo.com/hedgerwow?l=1&#038;u=5&#038;mx=120&#038;lmt=5">Hedger Wang</a> responded to my desperate plea for help on the <a href="http://www.last-child.com/conflicting-z-index-in-ie6/">z-index issue</a> with a <a href="http://www.hedgerwow.com/360/bugs/css-select-free.html">simple test page</a> on his blog with an ingenious iframe solution. How people imagine these solutions is simply beyond me.  So, then I started going through his blog and was blown away by his tests and solutions.  CSS, JS, AJAX, you name it, this is a goldmine on info.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/hedger-wang-is-god-well-a-guru-at-least/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Conflicting Z-Index in IE6</title>
		<link>http://www.last-child.com/conflicting-z-index-in-ie6/</link>
		<comments>http://www.last-child.com/conflicting-z-index-in-ie6/#comments</comments>
		<pubDate>Tue, 14 Mar 2006 03:35:37 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[:absolute]]></category>
		<category><![CDATA[:relative]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS2]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Z-Index]]></category>
		<category><![CDATA[position]]></category>
		<category><![CDATA[Cascading Style Sheets]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Internet Explorer 6]]></category>
		<category><![CDATA[Internet Explorer 7]]></category>

		<guid isPermaLink="false">http://www.last-child.com/conflicting-z-index-in-ie6/</guid>
		<description><![CDATA[Internet Explorer 6 has an issue with positioned elements that use z-index. Here&#8217;s the trouble I just had with this: I have a topnav consisting of an unordered list with a dropdown menu on one of the list elements. The dropdown is a nested unordered list with position:absolute and a z-index to sit on top [...]]]></description>
			<content:encoded><![CDATA[<p>Internet Explorer 6 has an issue with positioned elements that use z-index. Here&#8217;s the trouble I just had with this:</p>
<p>I have a topnav consisting of an unordered list with a dropdown menu on one of the list elements. The dropdown is a nested unordered list with  position:absolute and a z-index to sit on top of any page content below.  Fairly simple so far&#8230;</p>
<p>However, in IE6, the menu is obscured by an h5, random images, and paragraphs on various pages.  The z-index should make this list float on top of other elements, but it seems to be ineffective.</p>
<p><a href="http://www.quirksmode.org">PPK</a> summarized this problem on his post: <a href="http://www.quirksmode.org/bugreports/archives/2006/01/Explorer_z_index_bug.html">Explorer z-index bug:</a></p>
<blockquote><p>It appears that in Internet Explorer (windows) positioned elements do generate a new stacking context, starting with a z-index value of 0, causing the lime-green box to appear above the yellow box.</p>
<p>This is a serious violation of the CSS specifications, causing headaches and a lot of misunderstanding of what z-index really does.<cite><a href="http://www.quirksmode.org">PPK</a> </cite></p></blockquote>
<p>While crediting <a href="http://www.aplus.co.yu/css/z-pos/">Aleksandar Vacić</a> for first reporting this bug, PPK doesn&#8217;t mention Aleksandar&#8217;s simple solution. <strong>Give the parent a position:relative and z-index:1.</strong>.<br />
<iframe src="http://rcm.amazon.com/e/cm?t=csstoyslastch-20&amp;o=1&amp;p=8&amp;l=as1&amp;asins=0764579851&amp;md=10FE9736YVPPT7A0FBG2&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="margin: 5px; width: 120px; height: 240px; float: right;" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></iframe><br />
Now, of course it isn&#8217;t always that simple. There&#8217;s also the issue of subsequent objects that also have a z-index and what happens if their parent is also positioned with a z-index. Please take some time to visit Aleksandar&#8217;s web site if you are having this conflict.</p>
<h3>IE7 and more fun</h3>
<p>According to PPK&#8217;s web site, this has not been fixed in IE7 Beta2Preview. We&#8217;ll see how this works out. I&#8217;ve noticed some positioning bugs in IE7 myself. This is something to consider when considering the z-index happiness of <a href="http://24ways.org/advent/zs-not-dead-baby-zs-not-dead/">Andy Clarke</a></p>
<h3>More solutions</h3>
<p><a href="http://360.yahoo.com/profile-ktYYK_s5fqJ2Hu1ryv2QSL0-?cq=1">Hedger Wang</a> has an ingenious solution to the <a href="http://www.hedgerwow.com/360/bugs/css-select-free.html">conflict between z-index on elements and subsequent select elements</a>. He uses an iframe with z-index-1 that sits under the targeted element. I&#8217;ve used this negative z-index on some of the subsequent elements and it is helping. Fixing all of the pages will  be a long journey , but at least there is light at the end of the tunnel.</p>
<h3>Yet another hack/update</h3>
<p>I had to remove the negative z-index from the container as it was keeping a link with background image/text-indent, display:block, etc from having any hover activity. It acted as if it were under a layer. Other links in the container were fine. You&#8217;ve got to love IE6</p>
<h3>Yet another hack/update 4-30-06</h3>
<p>We were using an iframe with the src=&#8221;/&#8221;. Can you guess what happened?  Oh my goodness. We were loading the home page inside every other page on IE. So here&#8217;s the tip we learned&#8230; don&#8217;t use a page url for your invisible iframe, use an spacer.gif or something benign instead.  Better yet, get rid of the iframe if you find other solutions.  Which is what we ended up doing. We&#8217;ve messed with this thing for so long we&#8217;ve lost track of what&#8217;s doing what.<br />
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.cbc.ca/technology/story/2008/12/17/microsoft-security.html">Microsoft to issue emergency patch for Explorer security hole</a></li>
<li class="zemanta-article-ul-li"><a href="http://thenextweb.com/2008/12/16/dump-internet-explorer-at-least-for-now/">Dump Internet Explorer. You are Vulnerable.</a></li>
<li class="zemanta-article-ul-li"><a href="http://littlegreenfootballs.com/article/31490_Tech_Note-_IE6_Needs_an_Exorcism">Tech Note: IE6 Needs an Exorcism</a></li>
</ul>
<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/32bfa3b5-b81d-44f8-9248-aa2dbb0bcea7/" title="Zemified by Zemanta"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=32bfa3b5-b81d-44f8-9248-aa2dbb0bcea7" alt="Reblog this post [with Zemanta]"></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/conflicting-z-index-in-ie6/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
	</channel>
</rss>
