textarea的背景图片在IE8中输入其他文字滚动时 [英] Textarea background image scrolling when entering more text in ie8

查看:177
本文介绍了textarea的背景图片在IE8中输入其他文字滚动时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文本背景图片进入IE8更多的文字滚动的时候,我已经使用精灵概念输入的文本更显示出它的另一幅图像作为背景,所以当CSS

  textarea的{
  边框:0无;
  背景:网址(../图像/ sprite.png)不重复-272px -63px;
  最大高度:80px;
  最大宽度:191px;
  溢出-Y:汽车;
}


解决方案

由于微软纠正与IE7背景附件的问题,现在是不是有在输入或textarea元素文本的溢出,并没有背景的方式与文本滚动,如果你尝试背景附件:固定;背景甚至不显示。因为没有真正的CSS破解有什么解决问题,你需要想出的CSS。相反的风格正好textarea元素,使像textarea的容器补充DIV和背景图像应用到div,而不是文本区域。让无边框和背景的文本区域作出正确的覆盖。所以我使用code这样的

  .textarea_div {背景:网址(../图像/ sprite.png)不重复-272px -63px;}
textarea的边框{0无;
最大高度:80px;
最小高度:80px;
最大宽度:191px;
最小宽度:191px;}

HTML

 < D​​IV CLASS =textarea的>< TextArea>< / textarea的>< / DIV>

Textarea background image scrolling when entering more text in ie8, i have used sprite concept in css so when entered text more its showing another image as background

textarea{
  border:0 none; 
  background:url(../images/sprite.png) no-repeat -272px -63px; 
  max-height:80px; 
  max-width:191px; 
  overflow-y: auto;
}

解决方案

Since Microsoft "corrected" the background attachment issues with IE7 and now is no way of having an overflow of text in a input or textarea element and not having the background scroll with the text, and if you try "background-attachment: fixed;" the background doesn’t even display. Because is no really css hack what fix the problem, you need to think out of css. Instead to style just the textarea element, make a supplementary div like container for textarea and apply the background image to the div, instead to textarea. Let the textarea without border and background to make a proper overlay. so i am using code like this

.textarea_div{background:url(../images/sprite.png) no-repeat -272px -63px;}
textarea{border:0 none; 
max-height:80px; 
min-height:80px; 
max-width:191px; 
min-width:191px;}

HTML

<div class="textarea"><textarea></textarea></div>

这篇关于textarea的背景图片在IE8中输入其他文字滚动时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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