我正在使用 angular.js 和 angular-ui-router。 ui-view 元素的高度有点问题。它固定在视口(viewport)的高度而不是它的内容。随着内容的动态更新,内容的高度发生变化,但父 ui-view 元素的高度保持不变。因此,body 元素的高度也与 ui-view 的高度保持不变。如何解决这个问题
<body>
<div ui-view>
<div id = "content">
<!-- Some content with height more then that of view-port -->
</div>
</div>
</body>
最佳答案
这是一个 CSS 问题,而不是 Angular 问题。您的 body 可能已将高度设置为 100%。将其设置为
body {
height: auto;
}
会修复它。
A percentage height on the root element is relative to the initial containing block.
关于html - 调整ui-view元素的高度[Angular.js Angular UI Router],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27084206/