透明的div元素

问题描述

我有此代码:

<li class="nav-item dropdown" id="noti_Container" >
 <div id="noti_Counter" style="opacity: 1; top: -2px;"></div>
 <a style=" margin-right: 20px; color: white;" >
 <i class="fa fa-bell-o fa-lg" id="noti_Button" aria-hidden="true" ></i></a>
 <div id="notifications" style="display: none;">
  <h3>Notifications</h3>
  <div  id="not1"> </div>
  <div class="seeAll"><a href="#">See All</a></div>
 </div>
</li>

使用JavaScript代码生成通知,并将其添加到div not1中。我的问题是此div透明和背景中的元素显示出来。我在CSS中寻找透明和不透明,但没有找到。如何将其更改为正常的div外观? 后台的表格会干扰打开通知。应该注意的是,通知还包括表元素。也许这是问题的原始根源?

enter image description here

解决方法

您的问题不是透明性,它与CSS中的z-index属性有关。尝试更改前面和后面两个元素的z-index,看看会发生什么。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...