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

HTMLJavascriptProgramming

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>
Published on 13-Mar-2018 06:19:54