css - 不对称 CSS 阴影

标签 css

如何创建这样的阴影? 仅在底 Angular 和渐变处。

enter image description here

最佳答案

像下面这样使用你的 CSS。

HTML

<div class="box mybox">
    <h3>My Box</h3>
</div>

CSS

.box h3{
	text-align:center;
	position:relative;
	top:80px;
}
.box {
	width:70%;
	height:200px;
	background:#FFF;
	margin:40px auto;
}

/*==================================================
 * MyBox
 * ===============================================*/
.MyBox
{
  position: relative;
}
.MyBox:before, .MyBox:after
{
  z-index: -1;
  position: absolute;
  content: "";
  bottom: 15px;
  left: 10px;
  width: 50%;
  top: 80%;
  max-width:300px;
  background: #777;
  box-shadow: 0 15px 10px #777;
  transform: rotate(-3deg);
}
.MyBox:after
{
  transform: rotate(3deg);
  right: 10px;
  left: auto;
}
<div class="box MyBox">
	<h3>MyBox</h3>
</div>

关于css - 不对称 CSS 阴影,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39138390/

相关文章:

c# - 如何在 Outlook 中显示系统发送的电子邮件中的背景图像?

javascript - 更改 gltf 对象颜色的问题

html - 设置为相对时父容器不采用内容高度

c# - 如何从代码隐藏中将 CSS 类添加到 asp.net

javascript - 为在外部单击时关闭的图库图像创建预览效果

JavaFX - 将 css 文件添加到 Maven 元素

JavaScript/jQuery 事件未触发嵌套 <divs> 中的元素

Javascript/Css 导航未显示在仅在 ie 中准备就绪的 jquery 文档中

html - 修复了滚动文本列旁边的图像

javascript - css属性的自定义