Page is a not externally linkable
lucy24 - 8:08 am on Jun 16, 2012 (gmt 0)
Heh. Well, in the particular page I was playing with today, anything italicized and longer than one letter would also get a <lang> attribute. Excluding the ones that, er, don't, due to the "foreign-italics" vs. "emphatic-italics" thing. And the times I got lazy, figuring there's only so many ways for a speech reader to mispronounce <i>-up</i> ;) Some of the <i>s happen to have a class "locked", defined as {white-space: nowrap} because there's a leading hyphen. That has to remain independent.
The obvious selling point of <i> and <em> -- and also <u> and <tt>, which I use, dammit, so where does html5 get off dumping it? -- is that they're just one or two letters. Go to <span class = "blahblah"> and you're in a whole different level of bulkiness.
Sadly in this file-- and a bunch of similar ones-- I can't take it the other way around, using only <lang> and then styling with a pseudo-class. The non-English stuff uses two different physical formats. Italic if it's within body text-- standard practice for foreign languages-- but sans-serif it it's a free-standing line. Mm, yeah, I might be able to do something like
:: detour to look up exact wording ::
p:lang(iu)
versus
p :lang(iu)
but ooh, that looks iffy. Besides, sometimes I have consecutive lines and one of them's English.
But the material that originally prompted the question would work well with a pseudo-class. Currently I've got <td class = "translit"> formatted as sans-serif. (Yes, a table is the most appropriate format, thank you for asking.) Those could all be replaced globally with <td lang = "iu"> and then the css would say
td:lang(iu) {and then all the style stuff that currently goes with the "translit" class}
w3c says:
The pseudo-class ':lang(C)' matches if the element is in language C. Whether there is a match is based solely on the identifier C being either equal to, or a hyphen-separated substring of, the element's language value, in the same way as if performed by the '|=' operator.
I have tried reading this upside-down, sideways and backward, but still can't get that second sentence to be English.