z-index的问题,效果出现不了

http://img.mukewang.com/587f09aa0001a0a913380259.jpg

想让红色的层到 白色的层下面

然后用了,z-index没有效果。。。。不知道怎么了?



<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title></title>

</head>

<!--<link rel="stylesheet" href="css/normalize.css">-->

<style type="text/css">

*{

margin: 0;

padding:0;

}

.graph{

/* z-index: 99;*/

width: 1000px;

height: 300px;

margin: 100px auto;

text-align: center;

/*font-size:24px;*/

}

.effect{

position:relative;

box-shadow: 0px 1px 4px rgba(0,0,0,0.3),0px 0px 20px rgba(0,0,0,0.1) inset;

-webkit-box-shadow: 0px 1px 4px rgba(0,0,0,0.3),0px 0px 20px rgba(0,0,0,0.1) inset;

-moz-box-shadow: 0px 1px 4px rgba(0,0,0,0.3),0px 0px 20px rgba(0,0,0,0.1) inset;

-ms-box-shadow: 0px 1px 4px rgba(0,0,0,0.3),0px 0px 20px rgba(0,0,0,0.1) inset;

}

.effect:after{

content:'';

position:absolute;

left:53px;

top: 50%;

width: 90%;

height: 50%;

z-index: -1;

background:#f00;

border-radius: 100px/10px;

box-shadow:0px 1px 20px rgba(0,0,0,0.8);

-webkit-box-shadow:0px 1px 20px rgba(0,0,0,0.8);

-moz-box-shadow:0px 1px 20px rgba(0,0,0,0.8);

-ms-box-shadow:0px 1px 20px rgba(0,0,0,0.8);

}

</style>

<body>

<div class="graph effect">

<h1>曲线阴影</h1>

</div>

</body>

</html>


qq_小盛开_0
浏览 1378回答 1
1回答

慕数据5775487

你两个类名都是同一个DIV怎么会出效果。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

CSS3