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

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

王林
Release: 2023-09-09 10:05:02
forward
828 people have browsed it

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

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

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

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

    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!

source:tutorialspoint.com
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