Css and html tips

I need CSS and style tips, the question is not easy,

I am in the development of a project that will be in several languages, I know how to manage dictionaries, at least for now, but I had a big problem ...

The page on which it will be in English, as well as Japanese and Hebrew, have a different style, which they look and read from right to left on some pages.

How can i do this? I thought about using templates, but it’s not so easy to do, another option did it again.

Is there a way to work with css to invert the view, for example, the first button on the right and the logo, and so on?

Thanks and sorry for my english.

+3
source share
1 answer

Try to indicate <html dir="rtl">in your markup for languages ​​that need support from right to left. Perhaps you can make a comparison of all languages ​​(keys) and directions (values). Then, based on the language, specify the direction for the element html.

I would read: http://www.w3.org/International/tutorials/bidi-xhtml/

If for some reason you need to leave it on the left on a specific element, just specify the dir attribute on it: <div dir="ltr"></div>

In addition, you can probably set the class in the element bodyor htmldepending on the direction. And based on this, you can, for example, swim things to the right or left, if you need.

body #foo { float: left; }
body.right-to-left div#foo { float:right; }
+3
source

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


All Articles