问题描述
我有此代码:
<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外观? 后台的表格会干扰打开通知。应该注意的是,通知还包括表元素。也许这是问题的原始根源?
解决方法
您的问题不是透明性,它与CSS中的z-index属性有关。尝试更改前面和后面两个元素的z-index,看看会发生什么。