滚动时重画页面边框 [英] Redraw page border on scroll

查看:124
本文介绍了滚动时重画页面边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网页内容使用自动保证金居中,并在两侧(左侧和右侧)都有黑色边框。

My webpage content is centered in the middle using auto margin and has a black border on both sides (left and right).

如果向下滚动,边框不更新。所以如果我向下滚动一下,边框只会下降一半。我如何解决这个问题?

If I scroll down, the border doesn't update. So if I scroll down a bit the border will only reach half way down. How do i fix this?

编辑:内容div的高度设置为100%,在初始加载时边框会一直向下,只有这个问题发生在滚动时。

The height of the content div is set to 100% and on initial load the border does go all the way down, this problem only occurs when scrolling.

推荐答案


内容div的高度设置为100%

The height of the content div is set to 100%

这可能是您的问题。因为您已将div设置为 height:100%,所以它只与视口一样高。 (尽管内容溢出了)。

This is likely your problem. Because you've set the div to height: 100% it's only as tall as the viewport. (Even though the content overflows out of it.)

试试: min-height:100%

这篇关于滚动时重画页面边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆