今天才发现,万恶的IE居然iframe无法用css设置背景。
在网上搜了一会儿,发现大家都在叫苦连天,没有好的解决方案。(有的甚至连javascript都用上了。。。)
突然在IE Developer Toolbar的自动补全列表中,发现一个属性,allowTransparency。
msdn说:
Sets or retrieves whether the object can be transparent.
Remarks
When the property is set to false, the backgroundColor property of the object can only be that of the window. When the property is set to true, the backgroundColor property of the object can be set to any value, including the default value of transparent.
于是将iframe设置上allowtransparency="true" 实验通过。iframe变成透明的了。