
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to 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>
- Related Articles
- How to display text Right-to-Left Using CSS?
- How to display deleted text in HTML?
- How to handle right-to-left and left-to-right swipe gestures on Android using Kotlin?
- How to create a Box to display components from left to right in Java
- How to handle right-to-left and left-to-right swipe gestures on Android?
- Display strikethrough text in HTML
- Display subscripted text in HTML
- How to display the JList items from top to bottom and left to right in Java?
- How do we display inserted text in HTML?
- How to handle right-to-left and left-to-right swipe gestures on iOS App?
- How do we display a text area in HTML?
- How to include an alternate text when the original element fails to display in HTML?
- How to handle right to left swipe gestures?
- How to display a URL which explains the quote/deleted/inserted text in HTML?
- How to display multiple outputs on an HTML webpage using PowerShell?

Advertisements