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

标签 css roundedcorners-dropshadow

我从这里读到了 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/

相关文章:

swift - 如何在 Swift 3 的 TableView Cell 中设置具有更高值 t 的右上角半径

uiview - 无法在 ImageView 拉伸(stretch)到其边界的图层上设置cornerRadius和阴影?

objective-c - 带圆角的 UIView CAGradient?

css - 在 css 按钮周围创建一个区域

html - 通过表中的 td 编号设置 td 宽度

css - Sharepoint 2013 CSS 旋转不工作

css - CSS 投影技术的最佳方法 - 非图像

css - 我不明白为什么 ID 不比类更具体

html - Firefox 中的表单布局损坏

具有样式的 CSS3 圆 Angular 文本框