uniapp-the perfect solution for content suspension at the top of the page

Just wrap a layer of label outside the top area to be suspended and set the following attributes. This area will automatically float to the top as the page scrolls.

.page_header {
position: sticky;
width: 100%;
left: 0;
right: 0;
/ * #ifdef H5 /
top: 44px; // adaptive web page
/
#endif /
/
#ifndef H5 /
top: 0; // Adapt to other platforms
/
#endif * /
z-index: 1;
}

The top of the effect picture is the area to be suspended:

Insert picture description here

29 original articles published · Liked 40 · Visits 30,000+

Guess you like

Origin blog.csdn.net/xiyunmengyuan/article/details/102589271