[thelist] hiding an HTML attribute with IE-condition?

James Hardy evolt at weeb.biz
Mon Aug 23 06:40:04 CDT 2010

On 19 August 2010 14:52, Zhang Weiwu <zhangweiwu at realss.com> wrote:

> Short question: is there a hack that a certain HTML attribute should not
> be recognized by IE but by most other browsers? I know how to hide an
> element (IE conditional comment), how to hide a CSS definition (hacks),
> but how to hide a single attribute is not clear.
Well, the easy solution that springs to mind is to cheat a little, and write
the opening object tag twice using IE conditional comments, on to show only
on IE, and one to be hidden in IE 5+ (I think it is safe to ignore IE4-)

<!--[if IE]>
<parameter src="video.wmv">

<![if !IE]>
<object data="video.wmv">

Other contents including fallback information common to both


It is not elegant, but should work


More information about the thelist mailing list