前端选项卡无法选中,被图片遮挡

前端图片部分css代码如下

.map{  position:relative; height: 5.6rem; z-index: 9;}
.map4{ width: 7.78rem; /* 将宽度减少 20% */
	height: 6.5rem; /* 将高度减少 20% */
	position: relative; 
	  left: 50%; top: 4%;
	   margin-top: .1rem;
	margin-left: -3.9rem;
	z-index: 999;}
.map5{ width: 7.544rem; /* 将宽度减少 20% */
		height: 6.3rem; /* 将高度减少 20% */
		position: relative; 
	  left: 50%; top: 5%;
	   margin-top: .2rem;
		margin-left: -3.772rem;
		z-index: 9999;}
	
.map1,.map2,.map3{ position:absolute; opacity: .5}
.map1{ width:6.43rem; left: 53%; top: 27%;
	margin-top: .2rem;
	 margin-left: -3.772rem;z-index: 2;  animation: myfirst2 15s infinite linear;}
.map2{ width:5.66rem; left: 54.8%; top: 31%;
	margin-top: .2rem;
	 margin-left: -3.772rem; z-index: 3; opacity: 0.2; animation: myfirst 10s infinite linear;}
.map3{ width:5.18rem; left: 56%; top: 33%;
	margin-top: .2rem;
	 margin-left: -3.772rem; z-index: 1;}

vue选项卡css如下

*{
    margin: 0;
    padding: 0;
    z-index: 999999;
}
.box{
    width: 100%;
    height: 100%;
    /* margin: 100px auto; */
    z-index: 999999;
}
.box .header{
    height: 35px;
    width: 100%;
    line-height: 35px;
    z-index: 999999;
    
    
    
}
.box .header span{
    float: left;
    width: 100px;
    
    z-index: 9999999;
    text-align: center;
    color: #fff;
    cursor: pointer;
}
.box .header span:last-child{
    border-right: none;
    z-index: 999999;
}

可以看出来选项卡的z-index是999999,远大于图片的z-index。

但是为什么会出现遮挡现象?

在页面中使用右键,通过检查可以看到

所以只需要在选项卡的css中将position设置为static以外的即可

这样选项卡就不会被图片遮挡

另外可以多通过网页检查发现问题 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值