css让文字旋转90度

transform: rotate(90deg);

默认顺时针方向。逆时针填负数

<!DOCTYPE html>

<html lang="en">



<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <title>Document</title>

    <style>
        .box {

            width: 20px;

            height: 30px;

            transform: rotate(90deg);

            -ms-transform: rotate(90deg);

            /* Internet Explorer 9*/

            -moz-transform: rotate(90deg);

            /* Firefox */

            -webkit-transform: rotate(90deg);

            /* Safari 和 Chrome */

            -o-transform: rotate(90deg);

            /* Opera */

        }
    </style>

</head>



<body>

    <p class="box">123</p>

</body>



</html>

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注