我的sub-menu的背景图片为什么会是透明的?

我的sub-menu的背景图片为什么会是透明的?

*{
	margin:0;
	padding:0;
}

@font-face{
	font-family: "iconfont";
	src:url("../img/font/iconfont.eot");
	src:url("../img/font/iconfont.eot") format("embedded-opentype"),
	    url("../img/font/iconfont.woff") format("woff"),
	    url("../img/font/iconfont.ttf") format("truetype"),
		url("../img/font/iconfont.svg#iconfog") format("svg");
}
ul{
	list-style: none;
}

body{
	font-family: "微软雅黑";
	color:#14191e;
}
a:link,a:visited{
	text-decoration: none;
	color: #333;
}
.main{
	width:1200px;
	height: :460px;
	margin:30px auto;
	overflow: hidden;
	position: relative;
}
.banner{
	width:1200px;
	height:460px;
	overflow: hidden;
	position: relative;
}
.banner-slide{
	width:1200px;
	height:460px;
	background-repeat: no-repeat;
	position: absolute;
	display: none;
}
.slide-active{
	display: block;
}
.slide1{
	background-image:url("../img/bg1.jpg");
}
.slide2{
	background-image:url("../img/bg2.jpg");
}
.slide3{
	background-image:url("../img/bg3.jpg");
}
.button{
	position: absolute;
	width:40px;
	height: 80px;
	left:244px;
	top:50%;
	margin-top:-40px;
	background:url(../img/arrow.png) no-repeat center center;
}
.button:hover{
	background-color: #333;
	opacity: 0.8;
	filter:alpha(opacity=0.8);
}
.pre{
	transform:rotate(180deg);
}
.next{
	left:auto;
	right: 0;
}

.dots{
	position: absolute;
	right:20px;
	bottom:24px;
	text-align: right;
}
.dots span{
	/*水平排列*/
	display: inline-block;
	width:12px;
	height: 12px;
	border-radius: 50%;
	background: rgba(7,17,27,0.4); 
	margin-left: 8px;

	line-height: 12px;
	/*白色描边  内置*/
	box-shadow: 0 0 0 2px rgba(255,255,255,0.8) inset;
/*变小手*/
	cursor: pointer;
}
.dots span.active{
	box-shadow:  0 0 0 2px rgba(7,17,27,0.4) inset;
	background: #fff;
}
/*导航菜单*/
.menu-box{
	width:244px;
	height: 460px;
	position:absolute;
	left:0;
	top:0;
	background:rgba(7,17,27,0.5);
	opacity: 0.5;
	z-index: 1;
}

.menu-content{
	width:244px;
	height: 454px;
	position: absolute;
	left:0;
	top:0;
	padding-top: 6px;

	z-index: 2;
}

.menu-item{
	height: 64px;
	line-height: 66px;
	font-size: 12px;
	padding: 0 24px;
	position: relative;
}
.menu-item a:link,.menu-item a:visited{
	color:#fff;
}
.menu-item a{
	display: block;
	border-bottom: 1px solid rgba(255,255,255,0.5);
	padding: 0 8px;
	height: 63px;
}
.menu-item i{
	position: absolute;
	right: 32px;
	font-size: 24px;
	top: 2px;
	font-family: "iconfont";
	font-style: normal;
	font-weight: normal;
	color: rgba(255,255,255,0.5);
}
.sub-menu{
	width:730px;
	height: 460px;
	border:1px solid #d9dde1;
	background: #fff;
	position: absolute;
	left: 244px;
	top:0;
	z-index: 999;
	box-shadow: 0 4px 8px 0 rgba(0,0,0,0.1);

}

.inner-box{
	width:100%;
	height: 100%;
	background: url(../img/fe.png) no-repeat;
	display: none;
}

.sub-inner-box{
	width:652px;
	margin-left:40px;
	overflow: hidden;

}

.title{
	color:#f01414;
	font-size: 22px;
	line-height: 22px;
	margin:28px 0 30px 0;
	font-weight: bold;
}

.bold{
	font-weight: bold;
}
.mr10{
	margin-right: 10px;
}
.ml10{
	margin-left: 10px;
}
.sub-row{
	margin-bottom: 25px;
}
.hide{
	display: none;
}

http://img1.sycdn.imooc.com//climg/5b587cbc0001022509001600.jpg

正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

2回答
好帮手慕阿莹 2018-08-21 16:31:52

http://img1.sycdn.imooc.com//climg/5b7bcd210001eecd13890549.jpg

把同学的css代码放到老师的源码中是可以正常运行的。如果同学的代码还是有问题,建议同学提供一下你的html代码,让老师可以调试一下。

祝学习愉快。

好帮手慕阿莹 2018-07-26 10:58:03

box-shadow: 0 4px 8px 0 rgba(0,0,0,0.1);  中  rgba(0,0,0,0.1); 设置了颜色的背景透明度。

如果我的回答解决了你的疑惑,请采纳!祝学习愉快!

  • 老师,您这个回答不正确啊。您有仔细看帮同学调过代码吗?因为我做到这里也遇到了和这位同学一样的问题。您这里说的box-shadow: 0 4px 8px 0 rgba(0,0,0,0.1); 这里的0.1设置的是边框外圈的阴影效果啊,不是设置的背景颜色,这个地方是不影响的,希望老师能再帮忙看看。
    2018-08-21 15:07:52
  • 非常抱歉,这里是老师看错了,把同学的代码粘到老师的源码中发现运行是没有问题的,如果同学的代码也有问题,请同学单独写一个问答,把你的html和css代码都贴一下。让老师可以帮你调试一下你的代码。祝学习愉快。
    2018-08-21 16:30:51
  • 老师,关于这个我单独写了一下问题,您如果现在有时间不妨帮忙看一下,给出链接:https://class.imooc.com/course/qadetail/65098
    2018-08-21 16:54:55
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
从网页搭建入门Java Web2018版
  • 参与学习           人
  • 提交作业       1088    份
  • 解答问题       10204    个

如果你有Java语言基础,又想以后从事Java Web开发,那么本路径是你的不二选择!本路径从网页搭建开始入手,通过大量案例来学习Java Web基础。定能助你完成Java Web小白的蜕变!

了解课程
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师