【发布时间】:2015-07-27 08:46:55
【问题描述】:
我是谷歌应用脚本的新手。我尝试了一些示例,效果很好,但我坚持包含 css 文件。
在我的 code.gs 中,我创建了包含函数:
function include(filename) {
return HtmlService.createHtmlOutputFromFile(filename)
.getContent();
}
我还创建了 css 文件“Sidebar.css.html”,其中包含一些样式参数:
<style>
.branding-below {
bottom: 56px;
top: 0;
}
.branding-text {
left: 7px;
position: relative;
top: 3px;
}
.col-contain {
overflow: hidden;
}
.col-one {
float: left;
width: 50%;
}
.logo {
vertical-align: middle;
}
.radio-spacer {
height: 20px;
}
.width-100 {
width: 100%;
}
</style>
在我的 Sidebar.html 中,我尝试包含 css:
<?!= include('Sidebar.css.html'); ?>
这显然不起作用。结果如下:
在这个链接中你可以看到结果(我没有足够的代表来发布它,对不起):http://dl1.joxi.net/drive/0005/1191/378023/150727/371cdf01c0.jpg
我该怎么办?
【问题讨论】:
-
您是否明确输入了“.html”?如果没有,请不要包含它,只包含文件名
<?!= include('Sidebar.css'); ?>。如果有,请分享整个 code.gs。
标签: javascript html css google-apps-script google-sheets