我试图让我的Ember应用程序的根视图具有完整(100%)的高度,迄今为止失败。Ember视图高度
为什么我需要这个?即使页面内容没有填充整个高度,我也有一个页脚,我想将其对齐到底部。为此,我有以下的CSS:
.push {
height: 60px;
}
.content {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -60px;
}
和HTML(使用Twitter的引导):
<body>
<div class="navbar navbar-fixed-top"><!-- ... --></div>
<div class="content">
<div class="push"><!--//--></div>
<div class="container">
<!-- page content -->
</div>
<div class="push"><!--//--></div>
</div>
<footer>Copyright ... 2013</footer>
</body>
这不烬的伟大工程。现在,推出Ember:
<script type="text/x-handlebars" data-template-name="application">
<div class="navbar navbar-fixed-top"><!-- ... --></div>
<div class="content">
<div class="push"><!--//--></div>
<div class="container">
{{outlet}}
</div>
<div class="push"><!--//--></div>
</div>
<footer>Copyright ... 2013</footer>
</script>
现在它不再有效!
该死的东西插入一个<div id="emberXYZ" class="ember-view">
其中包含整个事情,其本身是相当好的,除了div没有完整的高度和页脚刚刚挂在页面的中间内容后。
我搜索了一个解决方案,但找不到任何可以解决此问题的方法。我的猜测是最简单的方法是让Ember将根视图设置为100%的高度(似乎无法找到如何做到这一点),但也许有一些其他聪明的技巧可以实现我想要的。无论是什么解决方案,我都需要它至少与IE8兼容。
在此先感谢!
为什么不''.container> div {min-height:100%; ''? – 2013-03-26 17:47:14
不幸的是,这并没有帮助。如果“内容”已经将最小高度设置为100%,则问题不是“容器”。问题是不支持完整高度的ember-view div。 – user510159 2013-03-26 19:59:04
哦,你的意思是应用程序视图。 App.ApplicationView = Ember.View.extend({classNames:['my-class']}) – 2013-03-26 20:09:56