【问题标题】:Image as heigh as what's left of page图片与页面左侧一样高
【发布时间】:2014-12-10 11:21:34
【问题描述】:

我有这个简单的导航栏和下面的图像视图。我希望图像视图的高度与没有滚动的剩余空间量一样高。如果你明白我的意思?我想我可以将height 设置为80% 或其他东西,但没有任何改变。

结构:

<div id="page">
<div id="navigation"></div>
<div id="content-container">here's my image view</div>
</div>

我希望content-container 的高度是页面的左侧。如果我将我的 page 的高度设置为 50% 也没有任何变化..

这是website

编辑:找到它:

body, html{position:absolute; height:100%;}
#page{position:relative; height:100%;}
#content-container{height:89%;} 

【问题讨论】:

  • 尝试将 100% 添加到 #page(或者您需要的任何内容),将 #nav 添加到 11%,然后将 #content-container 添加到 89%。认为这会成功,甚至在#page 上减少 %,因为他们是它的孩子

标签: css drupal


【解决方案1】:

试试这个

#navigation {
position: relative;
z-index: 10;
}
#content-container {
overflow:hidden;
position: absolute;
top: 70px; /* #navigation's height */
left: 0;
right: 0;
bottom: 0;
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-13
    • 2011-01-22
    • 2015-07-17
    • 2013-09-11
    • 1970-01-01
    • 2023-02-01
    相关资源
    最近更新 更多