On Tue, 24 Apr 2007, Patrick Aljord wrote:
> I trying to write this:
> <div style="direction:rtl">test (99)</div>
>
> but this is what appears:
>
> (test (99
At the character level, what appears is
)test (99
but the leftmost character ")" is displayed using a mirrored glyph.
You can see this if you copy the leftmost character into a plain text file
using copy and paste.
The appearance is what you asked for by using direction:rtl. By the
Unicode bidirectional algorithm (which is what the definition of the
direction property refers to), the writing direction is primarily
determined by the inherent directionality of characters. The directionally
neutral characters " " and "(" follow the directionality of surrounding
characters, which is left to to right. However, the last character ")" is
not trapped between characters with left to right directionality, so the
browsers does just what you asked: treats it with right to left
directionality. This means that it will be placed to the left of the
preceding text and mirrored.
Appending a directionally neutral punctuation character like "." would not
change this. It would be placed to the left of the preceding character.
But if you append a character with inherent left to right directionality,
like a Latin letter or a common (European) digit, things would change.
There is also an invisible control character for the purpose, the left to
right mark (LRM, U+200E), representable in HTML as ‎ among other
things.
> any idea how I could make it look like:
>
> test (99)?
Well, you could simply leave out the setting direction:rtl. If the
enclosing element has direction:rtl, then you would need to explicitly
set direction:ltr to prevent inheritance.
In any case, if you want text to be rendered left to right, you set (or
default) the direction property to the value ltr.
What did you expect the direction:rtl setting to affect, and why did you
use it? If you just want alignment to the right (which is a default side
effect of direction:rtl), set it explicitly, using text-align: right.
--
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/