Previous Message
Next Message

Max-Width in IE ala Svend Ofte - Make it validate?

Sent by Al Sparber on 15 January 2004 16:04

Ian P wrote:
> Is there any way to make Svend Ofte's excellent CSS
> scripting that simulates 'max-width' in IE [1]
> actually validate?
> I would love to be able to use max-width on my site,
> but the overwhelming majority of visitors use IE. Is
> there any way to let these pages validate while still
> using the script?

Sure. place it a conditional comment:

<!--[if gte IE 5]>
p {
border:1px solid red;
    document.body.clientWidth > (500/12) *
        "auto" );

Just check which versions of IE support css expressions and note that
in this particular comment "if gte IE5" means "greater than or equal
to" so it will be read by IE5.0, 5.5, and 6. Adjust as necessary. Also
not this comment needs to be embedded in your page and cannot reside
in an external css file.

Al Sparber

"Designing with CSS is sometimes like barreling down a crumbling
mountain road at 90 miles per hour secure in the knowledge that
repairs are scheduled for next Tuesday".

css-discuss [EMAIL-REMOVED]]
Supported by --
Previous Message
Next Message

Message thread: