<style>
.topbar {
position: sticky;
top: 0;
z-index: 9999;
}
</style>
position新添加的属性:sticky
z-index设置层级,避免被遮挡
<style>
.topbar {
position: sticky;
top: 0;
z-index: 9999;
}
</style>
position新添加的属性:sticky
z-index设置层级,避免被遮挡