Home > Article > Web Front-end > How to use css direction attribute?
CSS direction property is used to specify whether the text direction or writing direction is from left to right or right to left. The syntax is direction:ltr|rtl; set the attribute value to ltr, from left to right; to rtl, from right to left.
CSS direction attribute
Function:The direction attribute specifies the direction of the text /writing direction.
Description: The direction attribute specifies the basic writing direction of the block, as well as the embedding and covering direction for the Unicode bidirectional algorithm. UAs that do not support bidirectional text can ignore this attribute.
Basic syntax:
direction:ltr|rtl;
ltr: Default value, text direction is from left to right.
rtl: Text direction is from right to left.
Note: All browsers support the direction attribute.
Examples of using the CSS direction attribute
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文网(php.cn)</title> <style> div.ex1 {direction:rtl;} </style> </head> <body> <div>一些文本。默认的书写方向。</div> <div class="ex1">一些文本。 从右到左 df。!></div> </body> </html>
The above is the entire content of this article, I hope it will be helpful to everyone's learning.
The above is the detailed content of How to use css direction attribute?. For more information, please follow other related articles on the PHP Chinese website!