How to use css direction attribute?

青灯夜游
Release: 2019-05-25 15:29:44
Original
3831 people have browsed it

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.

How to use css direction attribute?

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;
Copy after login

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>
Copy after login

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!

Related labels:
css
source:php.cn
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!