2009-11-03 233 views
0

如何在设计时间更改iframe背景颜色?iframe背景颜色

按设计时间我的意思是以下内容: 我的类扩展了CompositeControl,其中我实现了设计时支持。

这是)的CreateChildControls的一部分(:

editor = new HtmlGenericControl("iframe"); 
editor.ID = "editorID"; 
editor.Style["background-color"] = "Red"; 
editor.Style["color"] = "Black"; 
editor.Style["position"] = "absolute"; 
editor.Style["left"] ="0px"; 
editor.Style["top"] = "0px"; 

editor.Attributes["width"] = editorWidth.ToString() + "px"; 
editor.Attributes["height"] = editorHeight.ToString() + "px"; 
editor.Attributes["frameborder"] = "0"; 
editor.Attributes["scrolling"] = "auto"; 

回答

2

必须设置任何网页的iframe指向(src属性)的背景;)

如果在iframe指向与你相同的域名,那么你可以使用Javascript来改变背景颜色或添加一个额外的样式表 - 但这还不是在设计时。

这是什么iframe的?

+0

iframe将用于创建富文本编辑器(designMode = on) – samuel 2009-11-03 16:54:54

+0

因此,在设计时没有办法改变它的颜色? – samuel 2009-11-03 16:55:33