2009-11-03 247 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