3 ms·
I would only use :lang pseudo class to style direction-specific documents/elements if I'd be certain that no other language of same direction will be added in t
by sergeylukin 13y ago
I would only use :lang pseudo class to style direction-specific documents/elements if I'd be certain that no other language of same direction will be added in the future (and I can never be certain in something like that).
Actually direction-specific styling is a different topic I think and I wish we had a :dir pseudo class or something for documents with multiple directions.
Usually RTL languages expect the whole layout (with few exceptions) to be in opposite direction and not just nav elements. So, if a document exists in LTR and RTL (or even TTB) languages I'd recommend having separate stylesheet for each direction instead (btw it can be achieved and maintained easily with CSS pre-processors).
If, however, multiple directions are mixed in one document, I'd probably use descendant selector instead:
body [dir="rtl"] p {}
or
body [dir="ttb"] p {}
etc.
I have yet to see such combinations however..