Can CSS stylesheets be bi-directional?

Can CSS be bidirectional or is it a style sheet essentially related to the direction of the script (RTL vs LTR)?

those. can one and a separate style sheet work for languages ​​from left to right (in English) and from right to left (in Hebrew)?

If so, what recommendations should be considered?

If not, how can I convert the ltr stylesheet to rtl?

+3
source share
3 answers

CSSJanus, ltr rtl. , , , . float: left to float: right ( , background-position). : ltr; !

, !

+2

, iGoogle, __BIDI_START_EDGE__, __BIDI_END_EDGE__, __BIDI_DIR__, and __BIDI_REVERSE_DIR__. CSS, , , - margin-left margin-__BIDI_START_EDGE__. , (ltr rtl), "", "", "ltr" "rtl" .

, , , , , "" "".

(. OpenAjaxIDE, : " IBM BIDI OpenSocial" OpenAjax.)

0

I would not recommend using a single stylesheet to support RTL and LTR styles. You will upload a large CSS file to use only half of it on the page.

Although, if you want to do this, you can add the class to the html tag, for example ('rtl' and 'ltr'), and use it in the stylesheet, as shown below:

.ltr .class {padding-left:10px;}
.rtl .class {padding-right:10px;}

You can check this tutorial to find out how to "RTL" on the LTR page.

0
source

Source: https://habr.com/ru/post/1719436/


All Articles