您的位置:程序门 -> java -> web 开发



图片滚动问题


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


图片滚动问题[已结贴,结贴人:yaoypdhc]
发表于:2007-08-15 20:36:24 楼主
代码:
<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中为什么就跟滚动条而滚动

求救!!!!

发表于:2007-08-15 20:56:291楼 得分:0
background-attachment:   fixed是在所使用的元素中固定,如果table随滚动条滚动的话,它就是滚动的。ie7更符合w3c规范
发表于:2007-08-15 20:59:462楼 得分:20
要实现固定效果,需要使用 <!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>
发表于:2007-08-15 21:06:573楼 得分:0
> 楼上
问题发错了
在ie6中图片跟滚动条而滚动
在ie7中为什么不跟滚动条而滚动



快速检索

最新资讯
热门点击