
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Display Text Right to Left Using HTML
The direction property specifies the text direction within a block element on the web page.
We use the style attribute, to set text direction in HTML. The style attribute specifies an inline style for an element within a block. The style attribute is used with the CSS property direction to set direction for the text.
Syntax
Following is the syntax to set text direction (right-to-left) using CSS property.
<p style = "direction: rtl;">The text?</p>
Example
Following is the example program to set direction to the <p> 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
Following is the example program to set direction to the <h2> element in HTML.
<!DOCTYPE html> <html> <head> </head> <body> <h2 style = "direction: rtl;"> Hallowen season it is... </h2> </body> </html>
Example
Following is the example program to set direction to the <ul> 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>
Advertisements