日期:2014-05-18  浏览次数:20775 次

图片滚动问题
代码:
<TR   valign= "top ">
<TD     class= "menu "   rowspan=3>
....

.menu   {
background-color:#ffffff;
background-image:   url( "../logo/top_image.jpg ");
background-repeat:   no-repeat;
background-attachment:   fixed;
}
问题:
在ie6中图片不跟滚动条而滚动
在ie7中为什么就跟滚动条而滚动

求救!!!!



------解决方案--------------------
要实现固定效果,需要使用 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN " "http://www.w3.org/TR/REC-html40/strict.dtd ">

例如

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN " "http://www.w3.org/TR/REC-html40/strict.dtd ">
<body>
<p> a </p> <p> a </p> <p> a </p>
<table width=200> <TR valign= "top ">
<TD height=300 class=menu> ff </td>
</tr>
</table>
<style>
.menu {
background-color:#ffffff;
background-image: url( "http://img2.265.com/pic/h004/h99/img20060914080546030.jpg ");
background-repeat: no-repeat;
background-attachment: fixed;
}
</style>
<p> a </p> <p> a </p> <p> a </p> <p> a </p>