滚动文本框内容溢出到填充区域

发布于 2024-09-01 12:21:28 字数 270 浏览 14 评论 0原文

如何阻止滚动条和滚动时的文本出现在顶部填充区域中。我是 Microsoft Expression Web 和 CSS 的新手,对此我感到非常沮丧。

这是我到目前为止所拥有的,但如上所述,文本仍然希望滚动到顶部 75px 的填充中,并且滚动条通过此顶部填充永久显示。

width: 210px;
float: left;
height: 220px;
overflow: auto;
padding-top: 75px;
padding-left: 35px:

How can I stop my scroll bar and the text when scrolled from appearing in my top padding area. I am new to Microsoft Expression Web and CSS and I am very frusterated with this.

Here's what I have so far but as mentioned above the text still wants to scroll into the top 75px of padding as well as the scroll bar is permantly displayed through this top padding.

width: 210px;
float: left;
height: 220px;
overflow: auto;
padding-top: 75px;
padding-left: 35px:

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

乞讨 2024-09-08 12:21:28

尝试使用“溢出”设置。首先尝试用“滚动”替换“自动”。如果您不想要滚动条(我对您的问题有点困惑),请将“自动”更改为“隐藏”。

让我知道这是否有效!

try playing with the "overflow" setting. First try replacing "auto" with "scroll." If you don't want the scroll bar (I'm a bit confused by your question) change "auto" to "hidden."

Let me know if that works!

听,心雨的声音 2024-09-08 12:21:28

抱歉,不允许我在 poindexter 的建议评论中添加评论,如下:

感谢您的建议,但是当我只想要一个垂直条时,将溢出更改为滚动会给我一个水平条和一个垂直条。 “自动”正确地做到了这一点。我会尝试更多地解释我的问题。

为了使我的文本在页面中正确定位,我必须在顶部和左侧创建填充。这会将文本移至页面下方和右侧。问题是滚动条出现时会超出文本开始的位置并进入填充。滚动文本后,您已经查看过的文本也会进入填充区域,并在到达 div 顶部时消失。希望这更有意义。该网站尚未上线,否则我会建议您访问该网站以查看视觉效果。

Sorry won't let me add a comment to poindexter's suggestion comment is as follows:

Thanks for your suggestions but changing the overflow to scroll gives me a horizontal and a vertical bar when I only want a vertical bar. "Auto" was doing this correctly. I'll try to explain a bit more my issue.

In order for my text to be positioned correctly within the page I have had to create padding in the top and left side. This moves the text lower in the page and to the right. Problem being that the scroll bar when it appears goes above where the text starts and into the padding. Once you scroll through the text, the text you have already looked at also goes into the padding area and disappears when it reaches the top of the div. Hope that makes more sense. The website isn't live or I would refer you to it for a visual.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文