css右上角文字倾斜

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .aaa{
            width:200px;
            height:200px;
            position:relative;
            background: #ccc;
            overflow: hidden;
        }
        .aaa .bbb{
            width:100px;
            height:100px;
            position: absolute;
            background: red;
            top:-50px;
            right:-50px;
            transform: rotate(45deg);
            color:#fff;
        }
        .aaa .bbb span{
            position: absolute;
            bottom:0;
            display: block;
            width:100px;
            text-align: center;
        }
    </style>
</head>
<body>
<div class="aaa">
    <div class="bbb">
        <span>文字倾斜</span>
    </div>
</div>
</body>
</html>

posted @ 2017-09-29 18:11  ljshu  阅读(1324)  评论(0编辑  收藏  举报