我在这里有一些简单的 CSS 来显示 web 应用程序的侧边栏,但是我无法让两个 DIV 并排显示。我使用了许多不同的 CSS 库,它们都具有相同的行为。
我的猜测是 caja 会碍事,但我不确定。
任何人都可以阐明这一点,或者提供解决方案吗?我希望有一个响应式设计,以便平板电脑/手机设备也可以使用这个应用程序。
代码.gs:
function doGet() {
return HtmlService.createTemplateFromFile('index').evaluate();
}
function include(filename) {
return HtmlService.createHtmlOutputFromFile(filename).getContent();
}
索引.html:
<?!= include('css'); ?>
<div id="left">Side menu</div>
<div id="right">Scroll
<br />Scroll
<br />Scroll
</div>
css.html:
<style>
html, body {
height: 100%;
margin: 0;
font-size: 20px;
}
#left {
width: 20%;
height: 100%;
position: fixed;
outline: 1px solid;
background: red;
}
#right {
width: 80%;
height: auto;
outline: 1px solid;
position: absolute;
right: 0;
background: blue;
}
</style>