小编Sac*_*jot的帖子

如何制作像youtube一样的叠加层

我有一个带navigation栏的简单网页.当切换我的导航栏时,我希望页面中的其余区域覆盖实时Youtube(下面附有一个示例图像).但是在尝试100次后,结果附在下面(下面附有一个样本图像).问题是它不是overlaying已定义color属性的元素.

在此输入图像描述在此输入图像描述

我的css代码实现叠加:

.overlay{
        width: 100%;
        position: fixed !fixed;
        height: 100%;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0,0,0,0.5) !important;
        z-index:0;
        cursor: pointer;
   }
Run Code Online (Sandbox Code Playgroud)

css html5 css3

2
推荐指数
1
解决办法
321
查看次数

标签 统计

css ×1

css3 ×1

html5 ×1