


<?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>Repeat Penguin &#187; html</title>
	<atom:link href="http://www.repeatpenguin.com/tags/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.repeatpenguin.com</link>
	<description>website design : xhtml : css : mobile web ~ Delivered Repeatedly by Jeremy Anderson</description>
	<lastBuildDate>Fri, 07 Oct 2011 04:54:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Got Layout?</title>
		<link>http://www.repeatpenguin.com/2007/11/26/got-layout/</link>
		<comments>http://www.repeatpenguin.com/2007/11/26/got-layout/#comments</comments>
		<pubDate>Mon, 26 Nov 2007 12:00:16 +0000</pubDate>
		<dc:creator>Jeremy Anderson</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[hasLayout]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.repeatpenguin.com/2007/11/26/got-layout/</guid>
		<description><![CDATA[* html body {display: none;} &#8230; I haven&#8217;t figured out why some think this hack is discriminatingGeorg position: relativity Ever wonder why applying a position: relative to an element in Internet Explorer can fix bizarre rendering problems? The standing theory, which is also a highly technical one, is that sometimes you just need to remind [...]]]></description>
			<content:encoded><![CDATA[<div class="liftout">
<blockquote cite="http://www.gunlaug.no/"><p>* html body {display: none;} &#8230; I haven&#8217;t figured out why some think this hack is discriminating<cite><a href="http://www.gunlaug.no/">Georg</a></cite></p>
</blockquote>
</div>
<p><img src="http://www.repeatpenguin.com/wp-content/uploads/2007/11/gotlayout.jpg" alt="got layout" title="got layout" width="512" height="138" /></p>
<h3>position: <span class="p">relativity</span></h3>
<p>Ever wonder why applying a <span>position: relative</span> to an element in Internet Explorer can fix bizarre rendering problems? The standing theory, which is also a highly technical one, is that sometimes you just need to remind IE that things need to flow in their natural order. As <em>logical</em> as that may sound, the problem really has to do with a little thing called <span><em>hasLayout</em></span>. </p>
<h3>display: <span class="p"><span style="text-decoration: line-through">none</span> inline-block</span></h3>
<p>This is not a new cat, nor a new bag, for that matter. Web designers have long been plagued with the rendering inconsistencies offered up by Internet Explorer, such as the <a href="http://positioniseverything.net/explorer/peekaboo.html">peek-a-boo</a> bug. Each of us, individually and as a community, have mapped these inconsistencies out and made record of them in our own bag of CSS tricks. None-the-less, IE still proves to be the most loathsome part of the job for many.</p>
<p>Though IE7 has made some pleasing improvements over it&#8217;s predecessors, it&#8217;s still a pitch or seven away from being adequate. So, I was very excited when I found <a href="http://www.satzansatz.de/cssd/onhavinglayout.html">On Having Layout</a>, an on going project focussed on understanding IE&#8217;s proprietary &#8220;Layout&#8221; property and how it is messing up <em>our</em> world.</p>
<p class="tr"><span id="more-53"></span></p>
<h3>hasLayout = true</h3>
<p><a href="http://www.satzansatz.de/">Ingo Chao</a>, one of the editors on this project has a background as a clinical physician as well as an editor. The clinical side definitely comes out in this article. It&#8217;s a comprehensive, well articulated study into &#8220;what the hell is going on with IE&#8221;. If you know what CSS is, you should read <a href="http://www.satzansatz.de/cssd/onhavinglayout.html">On Having Layout</a>.</p>
<h3>hasLayout = false</h3>
<p>The concept of &#8220;<a href="http://msdn2.microsoft.com/en-us/library/ms533776.aspx">Layout</a>&#8221; as a property, is something only to be expected from Microsoft. And, as you see by following the link, if you are using Firefox at least, the Microsoft Development Center official resources for this strange little property are anything but laid out well.</p>
<p class="center"><img src="http://www.repeatpenguin.com/img/20071126/ie_development_center.jpg" alt="microsoft development center rendering issues" /><span class="caption">Controlling Presentation with Measurement and Location Properties in Quirks Mode . . . umm?</span></p>
<h3>A Definition of <em>hasLayout</em></h3>
<p>Just as some people have <em>character</em> and others, not so much, according to Internet Explorer, so too do some elements in html have <em>Layout</em> and others, not so much. Because IE applies a seemingly arbitrary discrimination over it&#8217;s elements, we are tasked with stamping out a multitude of rendering bugs, when we write code.</p>
<h4>So what is <span><em>Layout</em></span> and how can I get me some?</h4>
<p class="quoted">&#8220;Layout&#8221; is an IE/Win proprietary concept that determines how elements draw and bound their content, interact with and relate to other elements, and react on and transmit application/user events.<span><a href="http://www.satzansatz.de/cssd/onhavinglayout.html">www.satzansatz.de</a></span></p>
<p><em>Layout</em> is irreversibly triggered by CSS. <em>hasLayout</em> for elements can either be set to <em>true</em> or <em>false</em>. Some elements, such as <span>&lt;html&gt;</span>, <span>&lt;body&gt;</span>, <span>&lt;table&gt;</span> and <span>&lt;img&gt;</span> appear to have <em>Layout</em> by default. While others can be given <em>Layout</em> by applying select CSS properties, such as <span>position: absolute</span>, <span>float: left|right</span> and <span>display: inline-block</span>.</p>
<p>Unlike other proprietary CSS for browsers, there is no <em>layout</em> property to declare and we are forced to interact with it in this very indirect way.</p>
<h3>Spilled Milk</h3>
<p>The <em>hasLayout</em> stumbling block has affected all designers and coders in their attempts to cross-broswer their work, and will continue to do so, to be sure. Its&#8217; unusual nature can upset the rendering of boxes, as well as their children. As indicated in <a href="http://www.satzansatz.de/cssd/onhavinglayout.html">On Having Layout</a>, consequences of an element having, or not having <em>layout</em> can include:</p>
<p class="quoted">
Many common IE float bugs.<br />
Boxes themselves treating basic properties differently.<br />
Margin collapsing between a container and its<br />descendants.<br />
Various problems with the construction of lists.<br />
Differences in the positioning of background images.<br />
Differences between browsers when using scripting.
</p>
<h3>These Bugs We Know</h3>
<p>Anyone who has laid code for the web is well aware of IE rendering bugs.  The work <a href="http://positioniseverything.net/" title="Holly on PIE">Holly Bergevin</a>, <a href="http://www.satzansatz.de/css.html" title="Satzansatz â€” CSS">Ingo Chao</a>, <a href="http://www.brunildo.org/" title="Brunildo â€” CSS">Bruno Fassino</a>, <a href="http://positioniseverything.net/" title="Big John on PIE">John Gallant</a>, <a href="http://www.gunlaug.no/" title="Web-carpenter and farm assistent">Georg SÃ¸rtun</a> and <a href="http://emps.l-c-n.com/" title="Empty Spaces">Philippe Wittenbergh</a> have put into creating this reference text is something every developer can benefit from and it could end up saving <em>you</em> considerable, hair-pulling time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.repeatpenguin.com/2007/11/26/got-layout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>friends of PNG</title>
		<link>http://www.repeatpenguin.com/2007/04/14/friends-of-png/</link>
		<comments>http://www.repeatpenguin.com/2007/04/14/friends-of-png/#comments</comments>
		<pubDate>Sat, 14 Apr 2007 17:57:18 +0000</pubDate>
		<dc:creator>Jeremy Anderson</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.repeatpenguin.com/2007/04/14/friends-of-png/</guid>
		<description><![CDATA[Alpha PNG Backgrounds in IE In the process of redesigning a site for a client, I stumbled into my long lost, woeful friend PNG. Actually, I shouldn&#8217;t be so hard on PNG. We all know who&#8217;s fault it really is. There are a ton of sources out there, offering solutions for the IE bug, but [...]]]></description>
			<content:encoded><![CDATA[<h2>Alpha PNG Backgrounds in IE</h2>
<p class="center"><img alt="cross browser variable opacity with PNG" class="nb" src="http://www.repeatpenguin.com/img/20070413/code.jpg" /></p>
<p>In the process of redesigning a site for a client, I stumbled into my long lost, woeful friend PNG. Actually, I shouldn&#8217;t be so hard on PNG. We all know who&#8217;s fault it really is. There are a ton of <a href="http://www.google.com/search?q=+iE+transparent+png+fix&#038;ie=utf-8&#038;oe=utf-8&#038;aq=t&#038;rls=org.mozilla:en-US:official&#038;client=firefox-a">sources</a> out there, offering solutions for the IE bug, but I needed something a little more comprehensive and involved a little less leg work.</p>
<p>My research led me to numerous sites, offering solutions to my PNG woes. Most of which either built upon or reiterated the <a href="http://www.alistapart.com/articles/pngopacity/">techniques</a> <a href="http://www.lovitt.net/">Michael Lovitt</a> discussed in <a href="http://www.alistapart.com/articles/pngopacity/">this article</a>, way back in the day.</p>
<p>For all the of the progress we&#8217;ve seen with IE7 (which <em>DOES</em> support transparent PNGs), we&#8217;re still left with the fact that it&#8217;s just a carrot dangling on a stick for a while more. We still have to deal with its predecessor and thus, I needed a clean solution that would do the leg work for me.</p>
<h3>Ping back PNG forward</h3>
<p class="center"><img alt="transparent PNGs for hidden divs" src="http://www.repeatpenguin.com/img/20070413/popdiv.jpg" /></p>
<p>To start with, there is a very simple solution to get IE6 to properly render transparent PNGs, using the <a href="http://msdn.microsoft.com/workshop/author/filter/reference/filters/alphaimageloader.asp">Microsoft AlphaImageLoader</a>. For simple tasks, I prefer to do this strictly using CSS and an IE6 conditional statement.</p>

<div class="wp_syntax"><div class="code"><pre class="css">/* IE6 PNG transparency FIX {--MEH!--} ----*/
* html #nav ul li {background-image: none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader »
(src=&quot;http://www.domain.com/img/myPNG.png&quot;, »
sizingMethod=&quot;scale&quot;);}</pre></div></div>

<p class="quote">(Line wraps are marked <span class="linewrap">»</span> <em>-Ed</em>)</p>
<p class="clear">This method of handling PNGs usually does the trick, for simple application. It&#8217;s concise and easy to implement. On an individual basis, it&#8217;s perfect. I should mention, there are two ways you can define your sizingMethod. The first, &#8220;scale&#8221; (shown above), is perfect for some repeating background images. There is a drawback. It works great for 1px by 1px images and 1px images for x or y repeats, but for tiling images you get some unappealing distortion happening. The other value for sizingMethod is &#8220;crop&#8221;. This is for non-repeating background images.</p>
<h3>the All-Around PNG</h3>
<p>This time, however, I needed something that would do a little more of the leg work for me. I needed something that would handle all of my PNGs at once. I stumbled across <a href="http://www.flopidesign.com/2006/05/26/transparent-pngs-used-as-css-background-images-in-internet-explorer/">this article</a> by <a href="http://www.flopidesign.com">John Labriola</a>, which proved to be the best solution for my needs. He worked off of a solution Drew, of <a href="http://allinthehead.com/retro/69">All in the Head</a> and came up with a stream lined approach, using minimal JavaScript. <a href="http://www.flopidesign.com/2006/05/26/transparent-pngs-used-as-css-background-images-in-internet-explorer/">Check it out</a>.</p>
<p>Based on <a href="http://allinthehead.com/retro/289/sleight-update-alpha-png-backgrounds-in-ie">sleight</a> he uses a simple function that loops through document.all to find all of your background PNGs and fix them. You can download his updated version of <a class="download" href="http://www.repeatpenguin.com/scripts/bgsleight.js">bgsleight.js</a> here.</p>
<h3>Better dropdowns and hidden divs, using transparent PNGs</h3>
<p class="center"><img alt="transparent PNG for drop menu" src="http://www.repeatpenguin.com/img/20070413/dropdown.jpg" /></p>
<p>Now you&#8217;ve got all you need to make sexy dropdowns, hidden divs, icons and whatever else you come up with.<code></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.repeatpenguin.com/2007/04/14/friends-of-png/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

