我嘗試使用position:relative 來做到這一點,但我想要自適應站點,所以它不適合我。在我嘗試制作 svg 圖像后,但它不能包含文本。我怎樣才能做到這一點?
1 回答

一只萌萌小番薯
TA貢獻1795條經驗 獲得超7個贊
我確信還有一百種方法。這是其中之一:
div {
width: 100px;
height: 40px;
position: relative;
background: green;
display: flex;
justify-content: center;
align-items: center;
color: white;
}
div:before {
content: "";
position: absolute;
right: -20px;
bottom: 0;
width: 0;
height: 0;
border-left: 20px solid green;
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
}
<div>4.7</div>
- 1 回答
- 0 關注
- 141 瀏覽
添加回答
舉報
0/150
提交
取消