Thursday, February 17, 2011

How do I get my blog to read from right to left


There are a few ways that you can create a blog with a right to left language such as Arabic, Hebrew or Persian. It is easiest to do this if you use a default Layouts template. If you use a Classic template, we recommend that you upgrade to Layouts.

Default Layouts Templates

For new blog owners and existing blog owners using Layouts, after you create a new blog or if you already have a blog, you will have to go to the Settings | Formatting tab,
and change your language to Hebrew, Arabic or Persian.
After you change your formatting language, click the orange Save Settings button at the bottom of the page and your blog will be set to display right to left in your selected language.

Classic Templates or Custom-Designed Layouts

If you want to keep your Classic template or customized Layout (meaning you have made changes to the Edit HTML page), you can still get your blog to read from right to left by going to the Template | Edit HTML tab and making the following edits to your code:
  1. Add dir="rtl" to the HTML tag
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="rtl">Note: You will not have to add a new dir attribute if your <html> tag already has expr:dir='data:blog.languageDirection' (Layouts) or dir="<$BlogLanguageDirection$>" (Classic templates) in it.
  3. Go through all of your CSS and change each instance of "left" to "right" and vice versa.
  4. In any line that has margin, padding or border, followed by exactly 4 values: swap the 2nd and 4th values. If there are fewer values, leave them alone. For example, you would change:
    padding:0 0 .25em 15px;
    to
    padding:0 15px .25em 0;

No comments:

Post a Comment