Question

I currently developing a multi-language interface for a Django project. But when I started to work on Arabic and Hebrew languages, I noticed all pages messed up after dir="rtl" to html tag (according to instructions on http://www.w3.org/International/tutorials/bidi-xhtml/)

Does that mean I need separate stylesheets for right-to-left languages?

Was it helpful?

Solution

Do not put the style attribute to the html tag.

Use the dir='rtl' attribute only inside the div's where you actually use Arabic and Hebrew. Not for the entire page.

OTHER TIPS

What you need to do in addition to adding the dir="rtl" to the tag is flipping your stylesheets. Create an rtl.css stylesheet which will act like a mirror to your default stylesheet. For example. If your style.css has this rule below:

.some-class { margin: 10px 5px 10px 7px; }

In the rtl.css it will be flipped like this:

.some-class { margin: 10px 7px 10px 5px; }

Check this: http://rtl-this.com/tutorial/3-different-ways-rtl-your-css

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top