VML need hasLayout

I happened to modify a page in last week, add <!DOCTYPE html> to make it CSS1Compat, and got a suprise: some vml graphics are missed.

I guessed it's due to hasLayout, as I understand, only element which hasLayout has chance to decide how to paint themselves, and vml is somehow like filter, must be processed by some special components, so they must hasLayout.

And after some test, I confirmed my idea.

VML elements are all inline by default, In CSS1Compat mode, inline element won't get layout via width or height, we need to add zoom:1, or display:block, or display:inline-block, or position:absolute.

Note: I just test IE6, no test on IE7.

发布了125 篇原创文章 · 获赞 0 · 访问量 36万+


©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客