
- 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 do we set the text direction for the content in an element in HTML?
Use the dir attribute in HTML, to set the text direction for the content in an element. You can try to run the following code to implement dir attribute −
Example
<!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>
- Related Articles
- How do we include the direction of text display in HTML?
- How do we set text font in HTML?
- How do we set the type of element in HTML?
- How to set text direction in HTML?
- How do we include an emphasized text in HTML?
- How to set that the text direction will be submitted in HTML?
- How do we set the visible number of lines in a text area in HTML?
- Enable an extra set of restrictions for the content in an in HTML?
- How to set HTML content of an element using jQuery?
- How do we display the thickness of the border of an element in HTML?
- How do we display inserted text in HTML?
- How do we include big text in HTML?
- How do we create underlined text in HTML?
- How do we create preformatted text in HTML?
- How do we add bold text in HTML?

Advertisements