Search code examples
htmlcssinternet-explorerarabicdirection

How to apply direction css attribute in list elements


I have some legacy html markup and I need to enable Arabic language support.

So, I have a list of news headlines and render them in <li> elements.

Here is sode:

..
<li>
<a>some Arabic text</a>
<em>news datetime</em>
</li>
..

So, I need to apply rigth text-alignment and direction rtl for anchor, but not for datetime. I applied text aligment for <li> element and everything is fine. But I need to apply "direction: rtl" style to anchor and here goes my problem.

I've tried to create <div> element with rtl direction attribute and put anchor into it. This works fine in chrome, but I need to support IE6+

Also I've tried to apply direction attribute to <li> and override this attr in <em>, but this doesn't work.

Any suggestions?

Thanks in advance, Vitali.


Solution

  • li {direction:rtl}
    em {direction:ltr; float:left}