热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

为什么三角形与菜单背景的颜色不同?-Whyisthetriangleadifferentcolourshadetothemenubackground?

Imnotunderstandingastowhythetrianglewhichappearswhenthemousehoversoverthemenuitem,

I'm not understanding as to why the triangle which appears when the mouse hovers over the menu item, does not come up the same shade of grey as the pop-up menu itself. Any clues as to whats happening here?

我不明白为什么鼠标悬停在菜单项上时出现的三角形与弹出菜单本身没有相同的灰色阴影。关于这里发生什么的线索?

Both CSS attributes are set to border-bottom-colour:#eee; for the triangle, and the background colour for the menu background as background-color:#eee;. however, it still results as pictured.

两个CSS属性都设置为border-bottom-color:#eee;对于三角形,菜单背景的背景颜色为背景颜色:#eee;。然而,它仍然如图所示。

enter image description here

#slide-down-banner ul li:hover ul.main-menu-scroll-dropdown{
    display:block;
    width:100%;
    background-color:#eee!important;
    left:0;
    right:0;
    color: black;
    border-bottom-style:solid;
    border-width:5px;
    border-color:#3A83F3;
    padding:30px;
    padding-bottom:20px;
    -webkit-box-shadow: -1px 9px 22px 0px rgba(0,0,0,0.75);
    -moz-box-shadow: -1px 9px 22px 0px rgba(0,0,0,0.75);
    box-shadow: -1px 9px 22px 0px rgba(0,0,0,0.75);
}
#slide-down-banner ul li:hover > a:after {
    content: "";
    display: block;
    border: 12px solid transparent;
    border-bottom-color:#eee!important;
    position: absolute;
    bottom: 0px;
    left: 50%;
    margin-left: -12px;
}

1 个解决方案

#1


1  

That darker grey is caused by the box-shadow on top of the triangle:

深灰色是由三角形顶部的盒子阴影引起的:

box-shadow: -1px 9px 22px 0px rgba(0,0,0,0.75);

You might want to try and use z-index to put the triangle on top of the shadow:

您可能想尝试使用z-index将三角形放在阴影的顶部:

#slide-down-banner ul li:hover > a:after {
    // ...
    z-index: 999;
}

推荐阅读
author-avatar
looloSam
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有