I have a community web site and I want that users write
- English posts with direction LTR / text-align: left) and
- Arabic posts with direction RTL / text-align: right.
E.g. Google+ and twitter provides such an POST solution.
I want add automatically direction attribute to post when i read it from data base post load in rtl or ltr ! but i don’t know how ?!
You’ll need to create a function that has all the letters you know are RTL and check when loading. To display RTL you need the CSS attributes,
direction,text-align, andunicode-bidi.Demo:
Script
CSS
HTML