答案 0 :(得分:3)
.sample{
height: 200px;
width: 200px;
background: red;
position: relative;
}
.sample::after{
width: 0;
height: 0;
border-style: solid;
border-width: 25px 0 25px 50px;
border-color: transparent transparent transparent #FFF;
display: block;
content:"";
position: absolute;
top: 10px;
}

<div class="sample"> </div>
&#13;
.sample{
height: 200px;
width: 200px;
background: red;
position: relative;
}
.sample::after{
width: 0;
height: 0;
border-style: solid;
border-width: 25px 0 25px 50px;
border-color: transparent transparent transparent #FFF;
display: block;
content:"";
position: absolute;
top: 10px;
}
答案 1 :(得分:0)
这可以帮助您实现目标。
.sample {
height: 200px;
width: 160px;
background: #fff;
position: relative;
border: 2px solid #000;
}
.sample::after {
border-color: transparent transparent transparent #000;
border-style: solid;
border-width: 20px 0 20px 30px;
content: "";
display: block;
height: 0;
position: absolute;
top: 30px;
width: 0;
}
.sample::before {
border-color: transparent transparent transparent #fff;
border-style: solid;
border-width: 19px 0 19px 28px;
content: "";
display: block;
height: 0;
left: -2px;
position: absolute;
top: 31px;
width: 0;
z-index: 1;
&#13;
<div class="sample"></div>
&#13;
答案 2 :(得分:-1)
尝试以下代码
.sample{
height: 200px;
width: 200px;
background: #fff;
position: relative;
border:2px solid #000;
}
.sample::after{
width: 11px;
height: 11px;
border-style: solid;
border-width: 2px;
border-color: #000 #000 #fff #FFF;
display: block;
content:"";
position: absolute;
top: 30px;
left:-10px;
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
background-color:#fff;
}
&#13;
<div class="sample"></div>
&#13;