OZONE Asylum
FAQ
How can I use the 'max-width' CSS property in Internet Explorer?
This page's ID:
25116
Search
QuickChanges
Forums
FAQ
Archives
Register
You are editing "How can I use the 'max-width' CSS property in Internet Explorer?"
Who can edit an FAQ?
Anyone registered may edit an FAQ.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Based on this article: http://www.svendtofte.com/code/max_width_in_ie/ the following solution was suggested in our [25115] 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>[/code] For more information on IE's "dynamic properties": [ulist]* [url=http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/recalc.asp]About Dynamic Properties[/url] (msdn.microsoft.com) * [url=http://wsabstract.com/dhtmltutors/dynproperty.shtml]Introduction to Dynamic Properties[/url] (wsabstract.com)[/ulist] For more information on IE's "conditional comments": [ulist]* [url=http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp]About Conditional Comments[/url] (msdn.microsoft.com) * [url=http://www.quirksmode.org/css/condcom.html]CSS - Conditional Comments[/url] (quirksmode.org)[/ulist] The JavaScript functions used inside the expression are: [ulist]* [url=http://www.devguru.com/Technologies/ecmascript/quickref/math.html]Math.min[/url] (devguru.com) * [url=http://www.devguru.com/Technologies/ecmascript/quickref/parseint.html]parseInt[/url] (devguru.com) * [url=http://www.quirksmode.org/dom/getstyles.html]offsetWidth[/url] (quirksmode.org)[/ulist] [small](Created by [internallink=1695]kuckus[/internallink] on 02-25-2005 20:23)[/small] [small](Edited by [internallink=2185]poi[/internallink] on 02-26-2005 18:47)[/small] [small](Edited by [internallink=1695]kuckus[/internallink] on 02-26-2005 20:08)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »