请问我这个透明的阴影效果怎么不出现,哪段代码出问题了??

 <style>

.box{

width: 440px;

height: 440px;

margin: 100px auto;

position: relative;

}

.shadow{

width: 100%;

height: 308px;

background-color:-webkit-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,.1) 50%,rgba(0,0,0,.8) 90%,rgba(0,0,0,.9) 100%);

top: 30%;

position: absolute;

 </style>

<body>

  <div class="box">

<img src="images/f2.jpg" alt="">

<div class="shadow"></div>

<p>picture</p>

</div>

</body>


幕布斯2315112
浏览 1676回答 4
4回答

__YXQ__

那个属性是不是就是background而不是background-color....

幕布斯6393831

而且不该是background-color,应该是background-image

幕布斯6393831

为什么用渐变  直接用阴影不好莫?
打开App,查看更多内容
随时随地看视频慕课网APP