gpt4 book ai didi

css - 阴影 - 没有圆 Angular 或模糊阴影

转载 作者:行者123 更新时间:2023-11-28 12:52:10 25 4
gpt4 key购买 nike

我从这里读到了 css box shadow 属性: http://css-tricks.com/snippets/css/css-box-shadow/

我想使用类似的阴影:.one-edge-shadow
问题是我不希望阴影的 Angular 变模糊(和变圆)。

我怎样才能做到这一点? (最好优雅)。

编辑:
对比图:http://new.tsaviation.com/images/cpm155/drop-shadow-vs-bottom-shading.jpg

最佳答案

据我了解,您想要底部阴影,它的底 Angular 没有 radius 属性,对吗?

如果是这样,您可以“附加”一个基本上是具有渐变背景的 div 的“阴影”。

DEMO

HTML:

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<!-- Trick shadow -->
<div id="box">
<div class="shadow-bottom"></div>
</div>
</body>
</html>

CSS:

#box{
width:5em;
height:5em;
background-color:#6c6c6c;
margin:5em auto;
}

/* New shadow element */
.shadow-bottom{
position:relative;
top:5em;/*height of box*/
height:25%;
width:100%;
background: -moz-linear-gradient(top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0.65)), color-stop(100%,rgba(0,0,0,0))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a6000000', endColorstr='#00000000',GradientType=0 ); /* IE6-9 */

}

关于css - 阴影 - 没有圆 Angular 或模糊阴影,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16860262/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com