How to rotate text direction 90 degrees with css

醉折花枝作酒筹
Release: 2023-01-06 11:14:42
Original
8424 people have browsed it

You can use the transform attribute in css to rotate the text direction by 90 degrees. The syntax format is "transform: rotate(90deg)". The transform attribute indicates that the element applies 2D or 3D transformation. When the value is rotate, it is rotated. A positive number is clockwise rotation, and a negative number is counterclockwise rotation.

How to rotate text direction 90 degrees with css

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

<!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>
Copy after login

Effect:

Original effect:

Recommended learning: css video Tutorial

The above is the detailed content of How to rotate text direction 90 degrees with css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!