滚动时全屏显示背景高度

问题描述 投票:0回答:1

我具有以下嵌套:

body {
    app-root {
        app-block-page {
            app-block-content {
                div.wrapper {
                    *content*
                }
            }
        }
     }
}

[body具有width:100%height:100%

[app-block-page具有width:100%height:100%background-color: reddisplay:block

[app-block-content具有padding:100px 0display:flexjustify-content:centeralign-items:center

[div.wrapper具有width:80%

结果

enter image description here

问题

如何使背景色不滚动?

我只需要滚动表格。

html css scroll background-color
1个回答
0
投票

您应该可以在position:fixed上使用app-block-page

位置:固定;位置为固定的元素;定位相对于视口,这意味着它始终保持在同一视口中即使滚动页面也可以放置。顶部,右侧,底部和左侧属性用于定位元素。

来源:https://www.w3schools.com/css/css_positioning.asp

© www.soinside.com 2019 - 2024. All rights reserved.