开发者

iframe background color

How can I change iframe background color on design time?

By design time I mean the following: My class extends CompositeControl where i implement design-time support.

this is part of 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";

 ed开发者_开发知识库itor.Attributes["width"] = editorWidth.ToString() + "px";
 editor.Attributes["height"] = editorHeight.ToString() + "px";
 editor.Attributes["frameborder"] = "0";
 editor.Attributes["scrolling"] = "auto";


You have to set the background of whatever page the iframe is pointed to (the src attribute) ;)

If the iframe is pointing to the same domain as you, then you could use Javascript to alter the background color or add an additional stylesheet - but this isn't at design time, either.

What is this iframe for?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜