css实现卡片右上角的状态

1、成品展示

2、html部分

html 复制代码
<div class="itemBox">
    <div class="status">
         {{ statusList[item.status] }}
    </div>
</div>

3、css部分

css 复制代码
.itemBox {
    position: relative;
    overflow: hidden;
}
.status {
    height: 25px;
    line-height: 25px;
    background: #EC8E71;
    font-size:13px;
    color: #FFF;
    position:absolute;
    right:0;
    top:0;
    padding:0 20px;
    box-sizing: border-box;
    -webkit-transform-origin:left bottom;
    -moz-transform-origin:left bottom;
    transform-origin:left bottom;  // 设置变换原点
    -webkit-transform:translate(29.29%,-100%) rotate(45deg);
    -moz-transform:translate(29.29%,-100%) rotate(45deg);
    transform:translate(29.29%,-100%) rotate(45deg);  // 顺时针旋转45度
    text-indent: 0;
}
相关推荐
Highcharts.js5 小时前
Highcharts 云端渲染的真相:交互式图表与服务器端生成的边界
前端·信息可视化·服务器渲染·highcharts·图表渲染
zhuyan1086 小时前
Linux 系统磁盘爆满导致无法启动修复指南
前端·chrome
编程牛马姐7 小时前
独立站SEO流量增长:提高Google排名的优化方法
前端·javascript·网络
NotFound4867 小时前
实战指南如何实现Java Web 拦截机制:Filter 与 Interceptor 深度分享
java·开发语言·前端
Dontla7 小时前
高基数(High Cardinality)问题介绍(Prometheus、高基数字段、低基数字段)
前端·数据库·prometheus
whuhewei10 小时前
为什么客户端不存在跨域问题
前端·安全
妮妮喔妮10 小时前
supabase的webhook报错
开发语言·前端·javascript
qq_120840937110 小时前
Three.js 大场景分块加载实战:从全量渲染到可视集调度
开发语言·javascript·数码相机
yivifu11 小时前
手搓HTML双行夹批效果
前端·html·html双行夹注
奔跑的卡卡11 小时前
Web开发与AI融合-第一篇:Web开发与AI融合的时代序幕
前端·人工智能