Will CSS3PIE .htc file load for other browsers even they don't need?

后端 未结 3 1552
失恋的感觉
失恋的感觉 2021-01-20 00:35

I\'m using CSS3Pie to make round corners in IE which uses invalid CSS property

behavior: url(/PIE.htc);

If i keep this declarition in my ma

3条回答
  •  无人共我
    2021-01-20 01:22

    The spec says that browsers are to completely ignore declarations whose property names they don't recognize. This means, theoretically, that since behavior is an IE-only property, the url() should not be parsed, and the file not be downloaded by browsers other than IE.

    I ran a test on IE9 and Firefox 4, loading the CSS3 PIE tabs demo, and here's what F12 Developer Tools and Firebug show respectively in their network tabs. Notice that Firebug reports no attempt to request the /PIE.htc file. That means Firefox didn't load the file even though it was declared in your stylesheet, because it doesn't recognize the behavior property.

    IE9 (F12 Developer Tools)

    Firefox 4 (Firebug)

    The only reason I'd move that property to an IE-only stylesheet with conditional comments is if I don't want to pollute my main stylesheet with non-standard properties and/or hacks.

提交回复
热议问题