How do we set text direction in HTML for content within an element?

PHPz
Release: 2023-08-26 15:49:11
forward
1449 people have browsed it

How do we set text direction in HTML for content within an element?

Use the dir attribute in HTML to set the text direction of the content in the element. You can try running the following code to implement the 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>
Copy after login

The above is the detailed content of How do we set text direction in HTML for content within an element?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template