How do we include the direction of text display in HTML?


Use the dir attribute in HTML, to add the direction of the text.

Example

You can try to run the following code to include the direction of text display in HTML −

<!DOCTYPE html>
<html>
   <body>
      <p>This is demo text from left-to-right.</p>
      <p dir = "rtl">This is demo text from right-to-left.</p>
   </body>
</html>

Updated on: 24-Jun-2020

112 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements