Welcome to the OZONE Asylum FAQWiki!
Frequently Asked Questions
CSS

How can I use the 'max-width' CSS property in Internet Explorer? Differences Pages that link to <a href="https://ozoneasylum.com/backlink?for=25116" title="Pages that link to How can I use the &amp;#039;max-width&amp;#039; CSS property in Internet Explorer? Differences" rel="nofollow" >How can I use the &#039;max-width&#039; CSS property in Internet Explorer? Differences\

Based on this article:
http://www.svendtofte.com/code/max_width_in_ie/

the following solution was suggested in our Max-Width in IE thread:

code:
<html>
<head>
<style type="text/css">
#CssSelector {
        /* for Firefox, Opera and others: */
        max-width: 250px; 
}
</style>
<!--[if gte IE 5]>
<style type="text/css">
#CssSelector {
        /* For Internet Explorer: */
	width: expression(Math.min(parseInt(this.offsetWidth), 250 ) + "px"); 
}
</style>
<![endif]-->
</head>
<body>
        <div id="CssSelector">...</div>
</body>
</html>


For more information on IE's "dynamic properties":


For more information on IE's "conditional comments":


The JavaScript functions used inside the expression are:
+[ulist]* Math.min (devguru.com)

-



(Created by kuckus on 02-25-2005 20:23)
(Edited by poi on 02-26-2005 18:47)
(Edited by kuckus on 02-26-2005 20:08)

« BackwardsOnwards »

Show Forum Drop Down Menu