דניאל דנון wrote: > I've been working on some project of transforming LTR design into a > RTL(Right-To-Left) design. > > It seems like even when I set the direction to rtl, > background-position: Xpx Ypx seems to count X pixels from the left-top > corner and not from the right-top corner.
As far as I can see, that’s how it’s supposed to work. The background-position is defined in terms of left and right as spatial dimensions, not in terms of “start” and “end” positions that would depend on writing direction. > I've looked for ways to overcome this but only thing I've found is > making an extra DIV to hold it which is in my opinion isn't an ideal > solution. I don’t see why an extra element would be needed or would help. You simply need to set background-position so that it matches the text layout, which depends on writing direction. This implies that it is fairly difficult, if not impossible in practice, to design a style sheet that works independently of writing direction – but this is more or less obvious anyway. For example, margin-left sets the margin on the physical left, not on start of text. Theoretically, you could use selectors like [dir="rtl"], but I don’t think that’s practical. (For one thing, such a selector matches an element that has the dir property explicitly set to "rtl", as opposite to inherited directionality – and it’s not very practical to set directionality for every element explicitly with an HTML attribute.) -- Yucca, http://www.cs.tut.fi/~jkorpela/ ______________________________________________________________________ css-discuss [[email protected]] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
