IE6中LIST元素背景消失BUG

Posted on 2006-12-25 星期一

(本文翻译自ADOBE)

在IE6中如果list元素在一个浮动的容器中,并且此容器的position属性为relative的时候,li 或dt等列表元素的背景可能会消失不见。这是一个IE6的BUG。解决方法就是将列表项目的position属性也设置为relative。例如:

  1. /*CSS*/
  2. div#wrapper {
  3.     position: relative;  /* 导致 bug */
  4.     float: left;
  5.     width: 250px; 
  6. }   
  7. div#wrapper dt {
  8.     background:#CCCCEE; ;  /* 导致 bug */
  9. }
  10.  
  11.  
  12.  
  13.  
  14. /*HTML*/
  15. <div id=“wrapper”>
  16. <dt>List One</dt>  <!– this background won’t render –>
  17.     <dd>Subitem 1 </dd>
  18.     <dd>Subitem 2 </dd>
  19.     <dd>Subitem 3 </dd>
  20.     <dd>Subitem 4 </dd>
  21.     <dd>Subitem 5 </dd>
  22. <dt>List Two</dt>  <!– this background will render –>
  23.     <dd>Subitem 1 </dd>
  24.     <dd>Subitem 2 </dd>
  25.     <dd>Subitem 3 </dd>
  26.     <dd>Subitem 4 </dd>
  27.     <dd>Subitem 5 </dd>
  28. </dl>
  29. </div>
  30.  
  31.  
  32.  
  33.  
  34. /*解决方法,加入以下CSS定义*/
  35. ul, ol, dl { position: relative; }

如图:
列表背景BUG

样例下载:bug_481.zip


No comments have been added to this post yet.

留下评论

(必需)

(必需)


Information for comment users
Line and paragraph breaks are implemented automatically. Your e-mail address is never displayed. Please consider what you're posting.

Use the buttons below to customise your comment.


RSS feed for comments on this post | TrackBack URI