问题描述
有类似的问题:
没有令人满意的答案。
在我的情况下,我在Google协作平台中嵌入了一个简单的Apps脚本:
CODE.GS
函数doGet(){
return HtmlService.createTemplateFromFile('Page')
.evaluate()。setSandboxMode (HtmlService.SandboxMode.NATIVE);
}
PAGE.HTML
< HTML>
< body style =background-color:transparent>
我如何制作< br />透明?
< / body>
< / html>
导致页面如下所示:
即使设定
< body style = 背景色:透明>
如果作为直接的XML封装的小工具实现,它会失败(我怀疑CAJA) 。这里有一个关于这个问题的讨论:
但是,无济于事。谢谢
b
您可以 。小工具可以通过http与谷歌应用脚本进行交流。
There is a similar question in:Google App Script background transparent with HtmlServicewith no satisfactory answer.
In my situation, I have this simple Apps Script embedded in Google Sites:
CODE.GS
function doGet() {
return HtmlService.createTemplateFromFile('Page')
.evaluate().setSandboxMode(HtmlService.SandboxMode.NATIVE);
}
PAGE.HTML
<html>
<body style="background-color:transparent">
How do I make it<br/>transparent ?
</body>
</html>
resulting in a page that looks like this:
https://sites.google.com/site/seanpj01/backtest
Even if the trick of setting
<body style="background-color:transparent">
works if implemented as a straight XML-wrapped gadget, it fails in this situation (I suspect CAJA). There is a discussion on this problem here:http://productforums.google.com/forum/#!topic/sites/KU9nSz37c6U
but again, to no avail. Thanks
Don't use html, head, or body tags
Instead you may create a gadget for your site. Gadgets can communicate to google apps script over http.
这篇关于使用HtmlService在站点应用程序脚本中透明背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!