Thetext…

Example The following is a sample program to set the direction of the

element in HTML. &"/> Thetext…

Example The following is a sample program to set the direction of the

element in HTML. &">

Home >Web Front-end >HTML Tutorial >How to display right-to-left text using HTML?

How to display right-to-left text using HTML?

王林
王林forward
2023-09-09 10:05:02846browse

How to display right-to-left text using HTML?

The direction attribute specifies the direction of text within block-level elements in a web page.

We use the style attribute to set the text direction in HTML. The style attribute specifies inline styles for elements within the block. The style attribute is used together with the CSS property direction to set the direction of text.

grammar

The following is the syntax for setting text direction (right to left) using CSS properties.

<p style = "direction: rtl;">The text…</p>

Example

The following is a sample program to set the direction of the

element in HTML.

<!DOCTYPE html>
<html>
<head>
</head>
<body>
   <p style = "direction: rtl;">
      whiteboards are so often at the core of a collaborative process
   </p>
</body>
</html>

Example

The following is a sample program to set the direction of the

element in HTML.
<!DOCTYPE html>
<html>
<head>
</head>
<body>
   <h2 style = "direction: rtl;">
      Hallowen season it is...
   </h2>
</body>
</html>

Example

The following is a sample program to set the direction of the

    element in HTML.
    <!DOCTYPE html>
    <html>
    <head>
    </head>
    <body>
       <ul style = "direction: rtl;">
          <li>Coffee</li>
          <li>Tea</li>
          <li>Milk</li>
       </ul>
    </body>
    </html>
    

The above is the detailed content of How to display right-to-left text using HTML?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete