gpt4 book ai didi

css - 成 Angular ,将 CSS 色带包裹在图像上

转载 作者:技术小花猫 更新时间:2023-10-29 11:27:15 28 4
gpt4 key购买 nike

仅使用 CSS 可以实现此功能区吗?

Example image of ribbon I'm trying to create in CSS

最佳答案

.box {
width: 300px;
height: 300px;
background-color: #a0a0a0;
position: relative;
}
.ribbon {
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
border: 25px solid transparent;
border-top: 25px solid #757575;
position: absolute;
bottom: 20px;
right: -50px;
padding: 0 10px;
width: 120px;
color: white;
font-family: sans-serif;
size: 11px;
}
.ribbon .txt {
position: absolute;
top: -20px;
left: 20px;
}​
<div class="box">
<div class="ribbon">
<div class="txt">
Example Text
</div>
</div>
<div>​

关于css - 成 Angular ,将 CSS 色带包裹在图像上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13071715/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com