简体   繁体   中英

How to create fixed toolbar under another toolbar

I want to create toolbar under toolbar, first toolbar is not fixed, second bar is fixed, second bar fixed in the top of the screen like in the site: https://www.lingvolive.com/ru-ru/translate/en-ru/overflow . How to do it in angular with material.

This isn't angular specific and can be accomplished with simple css. Here are some docs on the subject https://developer.mozilla.org/en-US/docs/Web/CSS/position#sticky_positioning

something like this should do it:

<div>top toolbar</div>
<div style="position: sticky; top: 0; position: -webkit-sticky;">Sticky Toolbar</div>

 <div>top toolbar</div> <div style="background-color: red; position: sticky; top: 0; position: -webkit-sticky;">Sticky Toolbar</div> <p>Padding for scroll</p> <p>Padding for scroll</p> <p>Padding for scroll</p> <p>Padding for scroll</p> <p>Padding for scroll</p> <p>Padding for scroll</p> <p>Padding for scroll</p> <p>Padding for scroll</p>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM