导航菜单是透明的,但我不确定为什么。我要背景
Navigation menu is transparent, but i'm not sure why. I want a background
- 我正在使用 wordpress 模板。
- 我刚刚添加了 particles.js 作为我的背景。
- 现在我的导航菜单采用与背景颜色相同的颜色,但我希望它是不同的颜色。 (我已经在我的代码中定义了颜色,但它不起作用)
这是我正在使用的代码以及我看到的代码。
.main-nav {
background-color: #585858;
background-image: -webkit-gradient(linear, left top, left bottom, from(#585858), to(#3d3d3d));
background-image: -webkit-linear-gradient(top, #585858, #3d3d3d);
background-image: -moz-linear-gradient(top, #585858, #3d3d3d);
background-image: -ms-linear-gradient(top, #585858, #3d3d3d);
background-image: -o-linear-gradient(top, #585858, #3d3d3d);
background-image: linear-gradient(to top, #585858, #3d3d3d);
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#585858, endColorstr=#3d3d3d)";
}
试试这个:
position: relative;
z-index: 100;
- 我正在使用 wordpress 模板。
- 我刚刚添加了 particles.js 作为我的背景。
- 现在我的导航菜单采用与背景颜色相同的颜色,但我希望它是不同的颜色。 (我已经在我的代码中定义了颜色,但它不起作用)
这是我正在使用的代码以及我看到的代码。
.main-nav {
background-color: #585858;
background-image: -webkit-gradient(linear, left top, left bottom, from(#585858), to(#3d3d3d));
background-image: -webkit-linear-gradient(top, #585858, #3d3d3d);
background-image: -moz-linear-gradient(top, #585858, #3d3d3d);
background-image: -ms-linear-gradient(top, #585858, #3d3d3d);
background-image: -o-linear-gradient(top, #585858, #3d3d3d);
background-image: linear-gradient(to top, #585858, #3d3d3d);
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#585858, endColorstr=#3d3d3d)";
}
试试这个:
position: relative;
z-index: 100;