如何设置 HTML 框架的背景颜色?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/593212/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 23:22:07  来源:igfitidea点击:

How do I set the background color of an HTML Frame?

htmlframes

提问by Borzio

I have a legacy website using frames. The pages within the frame do not use a white background and hence, I get an annoying "white flash" while the pages in the frames transition. I think this can be fixed by changing the background color of the <frame>, but no matter what is entered, Internet Explorer will NOT see anything but white. Firefox appears to accept the background color, but not so with IE.

我有一个使用框架的旧网站。框架内的页面不使用白色背景,因此,当框架中的页面转换时,我会看到令人讨厌的“白色闪光”。我认为这可以通过更改<frame>. Firefox 似乎接受背景颜色,但 IE 不接受。

NOTE: please don't flame me on using frames -- I know; heck, I think I've even preached it a time or too ... lol...

注意:请不要在使用框架时激怒我——我知道;哎呀,我想我什至已经宣扬过一次或太多......哈哈......

采纳答案by Borzio

I found this, rather obscure, piece of information;

我发现这个相当晦涩的信息;

Notice the **AllowTransparency**attribute -- That did the trick -- now, the RightBackground class can set the color as expected. Without the attribute, the color stays white (#ffffff), regardless.

注意**AllowTransparency**属性——这就是诀窍——现在,RightBackground 类可以按预期设置颜色。如果没有该属性,颜色将保持白色 (#ffffff),无论如何。

Reference can be found here: http://www.blooberry.com/indexdot/html/tagpages/f/frame.htm

参考可以在这里找到:http: //www.blooberry.com/indexdot/html/tagpages/f/frame.htm

<frame  allowTransparency="true" class="RightBackground" src="BottomRight.asp" marginheight="0" marginwidth="10px" name="BottomRight" />

Just FYI, the contents of RightBackground just sets the background color:

仅供参考, RightBackground 的内容只是设置背景颜色:

 <style type="text/css">
  .RightBackground
  {
     background-color: #EAF4D9;
  }
 </style>