Create a paragraph with a right-to-left direction in HTML5


Use the dir attribute in HTML to set a paragraph with right-to-left direction. Add the value rtl to the dir attribute for the text to be placed from right-to-left.

Example

You can try to run the following code to implement dir attribute −

<!DOCTYPE html>
<html>
   <body>
      <p dir="rtl">This is demo paragraph. This is demo paragraph.
         This is demo paragraph. This is demo paragraph. This is demo paragraph.
         This is demo paragraph. This is demo paragraph.</p>
   </body>
</html>

Updated on: 03-Mar-2020

248 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements