| Maximum width using CSS |
|
|
|
| Written by Websmurf | |
| Tuesday, 23 August 2005 | |
|
I recently found a neat CSS property when i was surfing the web. You can use the max-width style attribute to define a maximum width for a div or a table or other css object. usage: style="max-width: 200px;" or .myclass{ max-width: 200px; } This (ofcourse) will not work in Internet Explorer. To get the same in IE, use: width:expression(document.body.clientWidth > 200? "200px": "auto" ); So, for something that works in a lot of browsers, use: .myclass{ max-width: 200px; width:expression(200 + "px"); } |
|
| Last Updated ( Wednesday, 24 August 2005 ) |
| < Prev |
|---|