Plugin Author
Chouby
(@chouby)
Thanks. So if I for example have this in my style.css:
h1,h2{color:#333;letter-spacing:0px;line-height:20px;padding:10px 0;margin:0;border:0;color:#333;font:34px Georgia,Times, Verdana,Arial,Sans-Serif;border:0;}
..and I want to define the current font size (34px) only for the English version, while for the other language, I want 20px. How do I write this line in style.css?
And does the Polylang plugin set the language identifier?
It will provided your theme does:
<html <?php language_attributes() ?>>
Then you can html:lang(en) h1 { font-size: 34px; }
.
There is only one <html> tag in my theme’s header.php. Do you mean to put it inside there? (I’m not fluent in php, so maybe a silly question.)
I placed it inside the opening html tag in the header.php file, and that made it work (placing the relevant code in style.css).
It was also useful for me to let php print the language attribute on the page to show me what it looks like. The English code was “en-US”, not “en”. (But shouldn’t it work with only “en” too?)
Thank you both.
The language pseudo-class matches a hyphen-separated substring of the lang
attribute, so it would work with en
, en-US
, or en-CA
.