Right-to-Left Support

Right-to-left text direction support in Foundation allows you to easily switch text direction for all components.


Setup

Foundation was built to support right-to-left text direction out of the box, but you'll need to make a couple of adjustments to your markup and Sass to get everything up and running.

Markup Changes for Right-to-Left Languages

You'll need to make a few changes to your markup to get the Javascript components working nice and smooth. In thehtml tag, you'll need to add adir attribute with a value ofrtl. Here's what yourhtml tag should look like:

HTML

<!-- This example is for a right-to-left Arabic layout --><htmlclass="no-js"lang="ar"dir="rtl">

Change the Language Too

You'll need to change yourlang attribute value to match your language. Here's a handy list of common right-to-left languages and their html codes:

  • Arabic: ar
  • Chinese: zh
  • Farsi: fa
  • Hebrew: he, iw
  • Japanese: ja
  • Urdu: ur
  • Yiddish: yi, ji

A Single Sass Adjustment

We made it really easy to switch the entire Foundation grid to right-to-left by changing the$text-direction Sass variable. Here's what the variable should look like:

Sass

$text-direction: rtl;

By changing this single variable, the entire grid and all the Foundation components will be switched to right-to-left orientation.

Using CSS

If you prefer vanilla CSS, use the customizer to download Foundation and get right-to-left support. Your download should be ready to use without any of the steps mentioned above.

Download Right-to-Left Foundation »




Building Blocks Using Right-to-Left Support


Want more? Check out all the hotBuilding Blocks ⇨

Stay on top of what’s happening inresponsive design.

Sign up to receive monthly Responsive Reading highlights.Read Last Month's Edition »

Foundation for Sites

Foundation is a responsive front-end framework made byZURB, a product design company in Campbell, CA. This framework is the result of building web products & services since 1998.

Talk to us

Tweet us at
@ZURBfoundation

Business Support

Or check oursupport page

Stay Updated

Keep up with the latest on Foundation. Find us onGithub.

Stay Connected

© 1998‐2015 ZURB, Inc. All rights reserved.