css - 是否可以将此形状设置为白色边框和透明背景?

标签 css css-shapes

我想把这个形状放在里面透明,有一个白色的边框。问题是我不知道如何改变形状的右侧。我想做我在左侧所做的同样的事情。

我该怎么做?谢谢。

enter image description here

https://jsfiddle.net/2pz0kLd4/

代码:

.arrow-steps {
  width: 128px;
  height: 100px;
  border-top:1px solid white;
  border-left:1px solid white;
  border-bottom:1px solid white;
  margin-right:30px;
  margin-top:30px;
  position: relative;
  display:inline-block;
}
.arrow-steps:after {
  content: '';
  position: absolute;
  top: 0px;
  left: 128px;
  width: 0;
  height: 0;
  border: 50px solid transparent;

}
.arrow-steps:before {
  content: '';
  position: absolute;
  top: 0px;
  left: 128px;
  width: 0;
  height: 0;
  border: 50px solid transparent;
  border-left: 12px solid red;

}

.arrow-steps a{
display:block;
margin-top:36px;
color:white;
}

最佳答案

尝试这样的事情:

这是一个 fork

body{
background-color:black;
}

.arrow-steps {
  width: 128px;
  height: 100px;
  border-top:1px solid white;
  border-left:1px solid white;
  border-bottom:1px solid white;
  margin-right:30px;
  margin-left: 20px;
  margin-top:30px;
  position: relative;
  display:inline-block;
}
.arrow-steps:after {
  content: '';
  position: absolute;
  top: 0px;
  left: -12px;
  width: 0;
  height: 0;
  border-top: 50px solid transparent; 
  border-right: 12px solid red; 
  border-bottom: 50px solid transparent;
}

.arrow-steps:before {
  content: '';
  position: absolute;
  top: 0px;
  left: 128px;
  width: 0;
  height: 0;
  border-top: 50px solid transparent; 
  border-left: 12px solid red; 
  border-bottom: 50px solid transparent;
}

.arrow-steps a{
  display:block;
  margin-top:36px;
  color:white;
}

关于css - 是否可以将此形状设置为白色边框和透明背景?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28883662/

相关文章:

html - 如何水平对齐图像?

jQuery img 交换 - 保持宽度和高度

html - 使用 CSS 而不是 HTML 将图像与标题对齐

python - 在 Mac 上自动播放视频

java - 无法从 JSP 访问 WEB-INF 下定义的 CSS 文件

css - 如何三 Angular 形顶部和底部边框?

javascript - 对边半径

html - 如何创建具有空边界扇区和围绕该扇区 Angular 的圆 Angular 边框的圆圈

html - 半星和体透星

css - 同心圆与 CSS