CSS in the direction about the use of the detailed

Source: Internet
Author: User
One

In the ordinary application of the use of CSS direction very little attention, today occasionally see the relevant content, only found that CSS direction used a lot of time is very convenient.

Second, we need to focus on two important elements:

direction:ltr;//This is the default value Direction:rtl

The LTR is the initial value, which means left-to-right, which is the meaning from left to right. RTL is another value, right-to-left abbreviation, is the meaning from right to left.

<p class= "RTL" ></p>

If P is set to direction as the TRL attribute, then 1.png will be on the right and 2.png on the left.

It is important to note that if the RTL attribute is set, the order of the text is unchanged:

<p class= "RTL" ><span>span1</span> <span>span2</span></p>

Because the change is only inline element block of the left and right order, all the text, even if the use of inline tags separated, in fact, or a homogeneous inline box, is treated as a whole, so, only approximate to the correct alignment effect, and the specific text does not have the left and the next order of change.


What is the" inline element block "? including replacement elements (replaced element), such as , <button>, <input>, <video>, <object>, etc., Or a inline-block level element. Therefore, the above span1, span2 example, only any one span setting display:inline-block, will see the changes in the left and right order.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.