Open In App

CSS writing-mode Property

The writing-mode CSS property is used to signify whether the lines of text are laid out horizontally or vertically and also the direction in which the block progress. 

Syntax:



writing-mode: horizontal-tb|vertical-rl|vertical-lr;

Default Value: Its default value is horizontal-tb.

Property values:



Example: In this example, we are using writing-mode: horizontal-tb; property.




<!DOCTYPE html>
<html>
   
<head>
    <title>writing-mode Property</title>
    <style>
        p.geek {
            width: 300px;
            height: 100px;
            border: 1px solid black;
            writing-mode: horizontal-tb;
            color: white;
            background: green;
        }
    </style>
</head>
 
<body style="text-align: center;">
    <h1 style="color:green;">GeeksforGeeks</h1>
    <p class="geek">
        Geeks Classes is a classroom program in Noida.
        This is a quick course to cover algorithms
        questions.
    </p>
</body>
   
</html>

Output:

 

Example: In this example, we are using writing-mode: vertical-rl; property.




<!DOCTYPE html>
<html>
   
<head>
    <title>writing-mode Property</title>
    <style>
        p.geek {
            width: 200px;
            height: 200px;
            border: 1px solid black;
            writing-mode: vertical-rl;
            color: white;
            background: green;
        }
    </style>
</head>
 
<body style="text-align: center;">
    <h1 style="color:green;">GeeksforGeeks</h1>
    <p class="geek">
        Geeks Classes is a classroom program in Noida.
        This is a quick course to cover algorithms
        questions.
    </p>
</body>
   
</html>

Output:

 

Example: In this example, we are using writing-mode: vertical-lr property.




<!DOCTYPE html>
<html>
   
<head>
    <title>writing-mode Property</title>
    <style>
        p.geek {
            width: 200px;
            height: 200px;
            border: 1px solid black;
            writing-mode: vertical-lr;
            color: white;
            background: green;
        }
    </style>
</head>
 
<body style="text-align: center;">
    <h1 style="color:green;">GeeksforGeeks</h1>
    <p class="geek">
        Geeks Classes is a classroom program in Noida.
        This is a quick course to cover algorithms
        questions.
    </p>
</body>
   
</html>

Output:

 

Supported Browsers: The browsers that support the writing-mode property are listed below:


Article Tags :