是否有可能让柔性元素忽略子元素,因此它的大小不会影响其他元素?使柔性元素忽略子元素
例如,我有一个包装display: flex
。它有一个标题,内容和页脚。
<div class="wrapper">
<header></header>
<article></article>
<footer></footer>
</div>
我想包装忽略头标记(头将固定到窗口的顶部)。该文章将被设置为flex: 1
,因此它占据了剩余空间,强制页脚位于页面底部。下面是一些示例CSS:
.wrapper {
display: flex;
flex-direction: column;
height: 100%;
padding-top: 50px; /* Accounts for header */
}
header {
height: 50px;
position: fixed;
top: 0;
width: 100%;
}
article {
flex: 1;
}
footer {
height: 50px;
}
我知道我可以只动头的包装之外,但我有很多现有的代码,这将使这有点难度。我甚至可能问什么?
你能发布一个完整的工作示例吗? (一段) – Amit
http://stackoverflow.com/q/39069320/3597276 –
你在使用Firefox吗? –