我只是一个初学者在html。我试图使用背景图像的文本区域。它在firefox中看起来很好,但在internet explorer中就不行了。
.txt_area{
background-image:url(../images/textarea_normal.png);
background-color:transparent;
background-repeat:no-repeat;
color:#999999;
width:311px;
height:91px;
padding-left:35px;
padding-right:10px;
border:0px;
padding-top:10px;
padding-bottom:10px;
font-size:12px;
}
.txt_area:focus{
background-image:url(../images/textarea_focus.png);
color:#000000;
}
<textarea id="message" class="txt_area"
onFocus="remove_email('message','Message');"
onKeyPress="chgclr('message','Message')"
rows="" name="message" cols="">Message</textarea>
在internet explorer中,如果我在文本区域输入文本,背景图像也会随着内容滚动。我用的是ie7。我怎样才能改正呢?
尝试添加背景附件属性:http://www.w3schools.com/cssref/pr_background-attachment.asp