Skip to content

Instantly share code, notes, and snippets.

@mhmd-azeez
Created June 8, 2018 23:46
Show Gist options
  • Select an option

  • Save mhmd-azeez/afa4ce061571bda99bdd50cb33641b02 to your computer and use it in GitHub Desktop.

Select an option

Save mhmd-azeez/afa4ce061571bda99bdd50cb33641b02 to your computer and use it in GitHub Desktop.
Hebrew Content In GitHub - Right-To-Left Aligned - תוכן בעברית מיושר לימין

Note I: the exclamation-mark, it should be displayed as the last (not first) character,
this is a good way telling if the content is text aligned to the right.

Note II: A little confusing but it seems that in GitHub,
dir="RTL" is equal to CSS' text-align:right;, (inner-text is rendered from right-to-left)
while align="right" is equal to CSS' direction:rtl;, (container is rendered from the right-side)

Note III: As a best-practice, you should use both tag-attributes dir="RTL" and align="right" on a purely Hebrew paragraph, you can use it in DIV,P,SPAN,etc...
If you only want to include a Hebrew phrase inside a mostly English-content,
render the Hebrew content inside a SPAN with just dir="RTL", to render the content correctly. (You can add align="right" too but in that case it is redundant).

Note IV: It seems that STYLE attributes does nothing in GitHub...



<div dir="RTL" align="right" style="direction:rtl;text-align:right;">
(תוכן!)
</div>

example:

(תוכן!)

<div dir="RTL" align="right">
(תוכן!)
</div>

example:

(תוכן!)

<div align="right">
(תוכן!)
</div>

example:

(תוכן!)

<div dir="RTL">
(תוכן!)
</div>

example:

(תוכן!)

<div style="direction:rtl;text-align:right;">
(תוכן!)
</div>

example:

(תוכן!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment