html - 带阴影的 CSS 三 Angular 形

标签 html css

我使用 CSS 使用概述的代码制作了一个“三 Angular 形”HERE

(jsFiddle example)

效果很好,但我想像这样在三 Angular 形和条形上插入阴影:

enter image description here

如何?

HTML:

<div id="wrapper">
    <div class="triLeft"></div>
    <div class="triAngle"></div>
</div>

CSS:

.triLeft{
  width:40px;
  background:#fff;
  margin:0;
  float:left;
  height:200px;
}

.triAngle{
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 45px 0 45px 40px;
  border-color: transparent transparent transparent #ffffff;                  
  float:left;
  margin-top:20px;
}               

#wrapper{
  height:200px;
  background:brown;
}

最佳答案

你可以尝试另一种方式,没有边框但是 transform:rotate();

http://codepen.io/anon/pen/MymQMK

div.trgl {
  position:relative;
  margin:2em;
  overflow:hidden;
}
div.trgl:after {
  content:'';
  position:absolute;
  height:40px;
  width:40px;
  top:2em;
  left:-20px;
  background:white;
  box-shadow: inset 0 0 5px black ;
  transform:rotate(45deg);
}
div.trgl div{
  position:relative;
  min-height:200px;
  padding:1em;
  box-shadow: 0 0 5px black;
  margin:3px;
  background:lightgray;
}
<div class="trgl">
  <div>
  </div>
</div>

关于html - 带阴影的 CSS 三 Angular 形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36189147/

相关文章:

css - 我怎样才能停止 prepos 来创建除 main.scss 之外的某些已编译的 scss

html - 将图像堆叠在段落栏的顶部

javascript - 重新加载 div 的最佳方法是什么?

html - 在 Internet Explorer 7 中,文本对齐 : right is not taking effect

javascript - PHP 函数末尾的 0

html - 打印时不要重复 TFOOT

html - 在另一个内部对齐三个 div block

php - 位于页面右侧的左对齐文本有问题吗?

html - css: float div中的重叠标题h1

css - 图像上的响应文本不起作用