porry123 2015-05-30 07:25 采纳率: 40%
浏览 2209
已采纳

onmouseover不触发,望指教

a标签似乎是被覆盖了,但是找不到问题根源。z-index属性修改没有效果

CSS

 .demo{  width:1000px; height:442px; overflow:hidden;margin:0px;z-index:-1; padding:0px; position:relative; }
.num { bottom: 10px; right: 50px; width:auto;height:8px;z-index:10; position:absolute;}
.num a{cursor:pointer;  width:8px; height:8px; background:url(../images/bicon_bg.png) no-repeat bottom; margin-right:4px; float:left;display:inline-block; border:1px solid red;position:relative;z-index:50;}
.num a:hover {cursor:pointer; background:#ff7d01; width:8px; height:8px; display:block; color:#fff; }
.demo ul {position:relative;z-index:5;width:956px; }
.demo ul li {position:absolute; display:none; margin:0px;padding:0px;width:1000px; }
.demo ul li .demo-img{ width:1000px;height:442px;float:left; display:inline; }
.demo ul li .demo-img img{ width:1000px; height:442px;}
.demo .num a.cur{ background:url(../images/bicon_bg.png) no-repeat top; display:block;}

前端是这样的结构

 <div class="demo">
                            <div class="num">
                                                                        <a href="#" class='cur'></a>
                                                                        <a href="#" ></a>
                                                                        <a href="#" ></a>                                                                       
                                                        </div>
                            <ul>
                                <li style='DISPLAY: block' ><img src='imagestext/20140916064258.jpg'  width="1000" height="442"></li> 
                                 <li  ><img src='imagestext/20130531030129.jpg'  width="1000" height="442"></li> 
                                  <li  ><img src='imagestext/20140905105755.jpg'  width="1000" height="442"></li>                                  
                            </ul>
                        </div>
  • 写回答

6条回答

  • Go 旅城通票 2015-05-30 12:27
    关注

    .demo你设置z-index为-1不就到body后面了。。当然获取不到焦点了,去掉z-index:-1

         .demo {
            width: 1000px;
            height: 442px;
            overflow: hidden;
            margin: 0px;
           /* z-index: -1;*/
            padding: 0px;
            position: relative;
        }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?

悬赏问题

  • ¥15 fluent的在模拟压强时使用希望得到一些建议
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退