VML need hasLayout

来源:互联网 发布:mac os x 10.13 界面 编辑:程序博客网 时间:2024/05/21 11:07

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.

原创粉丝点击