<?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>And Slaters Go Plop &#187; max-height</title>
	<atom:link href="http://damian.peterson.net.nz/tag/max-height/feed/" rel="self" type="application/rss+xml" />
	<link>http://damian.peterson.net.nz</link>
	<description>The Bloggery of Damian Peterson</description>
	<lastBuildDate>Sun, 29 Aug 2010 19:01:01 +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>CSS max-width proportional scaling in IE6</title>
		<link>http://damian.peterson.net.nz/2008/03/19/css-max-width-proportional-scaling-in-ie6/</link>
		<comments>http://damian.peterson.net.nz/2008/03/19/css-max-width-proportional-scaling-in-ie6/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 21:19:37 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[ie6sux]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[max-height]]></category>
		<category><![CDATA[max-width]]></category>
		<category><![CDATA[proportion]]></category>
		<category><![CDATA[scaling]]></category>

		<guid isPermaLink="false">http://damian.peterson.net.nz/2008/03/19/css-max-width-proportional-scaling-in-ie6/</guid>
		<description><![CDATA[The CSS property &#8216;max-width&#8217; and &#8216;max-height&#8217; doesn&#8217;t work in Internet Explorer 6. Here&#8217;s a workaround: .myclass { width:expression(this.width &#62; 100 ? (this.height &#62; this.width ? (this.width / this.height) * 100 : 100) : true); } What does this do? It executes a bit of javascript within the CSS that goes along the lines of &#8220;If [...]]]></description>
			<content:encoded><![CDATA[<p>The CSS property &#8216;max-width&#8217; and &#8216;max-height&#8217; doesn&#8217;t work in Internet Explorer 6. Here&#8217;s a workaround:<br />
<code><br />
.myclass {<br />
    width:expression(this.width &gt; 100 ? (this.height &gt; this.width ? (this.width / this.height) * 100 : 100) : true);<br />
}<br />
</code><br />
What does this do? It executes a bit of javascript within the CSS that goes along the lines of &#8220;If the width is greater than 100 pixels then set the width to 100 &#8211; unless the height is greater than the width, in which case scale it down to the difference between the width and the height &#8211; otherwise just leave it as it is&#8221;.</p>
<p>This means that any element that is of .myclass will fit proportionately into a 100&#215;100 area (change the 100 for whatever max-width or max-height you require).</p>
<p>I hope this saves someone from having to figure this out in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://damian.peterson.net.nz/2008/03/19/css-max-width-proportional-scaling-in-ie6/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
