【发布时间】:2021-10-05 05:31:20
【问题描述】:
我尝试让标题中的菜单栏保持粘性。标题是一个垂直对齐的弹性框(弹性方向:列)。但正如您可能猜到的那样,它不起作用。
简化安排 here
HTML
<header>
<div id="quality-logos">
[some images here]
</div>
<div id="logo_motte_top">
[a big logo here]
</div>
<div id="navigation-wrapper">
<div id="navigation">
[some navigation code here]
</div>
<div id="menu_promo_text">
<div>Mo – Sa: 09 – 18 Uhr, So nach Vereinbarung</div>
</div>
</div>
</header>
CSS(缩短)
header{
height: 100vh;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
div#navigation-wrapper{
position:sticky;
top:0;
}
你可以在motteduesseldorf.de看到它的直播
【问题讨论】: