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;
}
相关推荐
遇到困难睡大觉哈哈1 天前
Harmony os 静态卡片(ArkTS + FormLink)详细介绍
前端·microsoft·harmonyos·鸿蒙
用户47949283569151 天前
Bun 卖身 Anthropic!尤雨溪神吐槽:OpenAI 你需要工具链吗?
前端·openai·bun
p***43481 天前
前端在移动端中的网络请求优化
前端
g***B7381 天前
前端在移动端中的Ionic
前端
拿破轮1 天前
使用通义灵码解决复杂正则表达式替换字符串的问题.
java·服务器·前端
whltaoin1 天前
【 Web认证 】Cookie、Session 与 JWT Token:Web 认证机制的原理、实现与对比
前端·web·jwt·cookie·session·认证机制
Aerelin1 天前
爬虫playwright入门讲解
前端·javascript·html·playwright
笙年1 天前
JavaScript Promise,包括构造函数、对象方法和类方法
开发语言·javascript·ecmascript
桜吹雪1 天前
LangChain.js/DeepAgents可观测性
javascript·人工智能
5***o5001 天前
前端在移动端中的NativeBase
前端