当文本超过高度时,文本区域背景图像滚动
我正在尝试解决 IE7 中的问题。
我的文本区域后面有一个背景图像,当文本超过文本区域的高度并开始随文本滚动时,背景图像会随文本滚动。
任何人都知道为什么会发生这种情况以及解决方案是什么?
谢谢, 詹姆斯
I am trying to resolve an issue in IE7.
My text area has a background image behind it which then scrolls with the text when the text exceeds the height of the text area and begins to scroll with the text.
Anyone know why this is happening and what the solution this would be?
Thanks,
James
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是 IE 6 和 7 才会出现的问题,在 IE8 中已得到解决。
要解决此问题,请尝试将
您可能仍然需要调整
This is a problem that only happens with IE 6 and 7, which has been resolved in IE8.
To fix the problem, try wrapping the <textarea> in a <div>. Apply the background and border properties of the <textarea> to the <div>, then set the border and background of the <textarea> to none.
You'll probably still need to tweak the margin and padding of both the <div> and the <textarea> to get it look just right, but now you should be pointed in the right direction.
您是否尝试过将 background-position 设置为
background-position :顶部中心;
?(或者类似
background-position: 50px center;
。)Have you tried setting the background-position to
background-position: top center;
?(Or something like
background-position: 50px center;
.)使用:
应该为您提供一个固定在文本区域框左上角的背景图像,当文本超过初始尺寸时该背景图像固定。
Using:
should give you a background image that is fixed to the top left of the textarea box that is fixed when the text exceeds the initial dimensions.