【发布时间】:2017-10-09 15:50:06
【问题描述】:
CSS - 如何在 CSS 中为自定义形状制作边框,以便边框仅位于我的形状的外边缘(而不是现在在内部)?
我正在使用带有 :before 和 :after 伪类的 div...
https://codepen.io/RobotHabanera/pen/oGqwez
这是 CSS :
.nosce {
box-sizing:border-box;
position:relative;
left:100px;
top:100px;
margin:0 auto;
width:850px;
height:570px;
background:orangered;
border: dashed 2px #000;
}
.nosce:before {
content:'';
position:absolute;
z-index:2;
left:-57px;
top:536px;
width:545px;
height:260px;
background:orangered;
border: dashed 2px #000;
}
.nosce:after {
content:'';
position:absolute;
z-index:1;
left:203px;
bottom:-285px;
width:285px;
height:30px;
background:orangered;
border: dashed 2px #000;
}
【问题讨论】:
-
我建议你使用 SVG 来创建这个形状。
-
svg 对我来说是一个新概念......所以我需要先学习 svs :) 但当然没问题只是需要时间
-
关于信息:在实现混合混合模式的地方,它可以在某些情况下使用codepen.io/gc-nomade/pen/aLYGww / developer.mozilla.org/fr/docs/Web/CSS/mix-blend-mode
标签: html css border css-shapes