我想改变风格取决于语言。 例如,当我将网站语言切换为阿拉伯语时,我希望我编写的rtl样式生效,并在切换回英语时取消设置rtl样式。 如何在Drupal 7中实现这一目标? 我试过这个答案,但对我不起作用。
I want to change the style depends on the language. For example, when I switch the site language to Arabic I want the rtl style that I wrote to take effect and to unset the rtl style when switching back to English. How to achieve that in Drupal 7? I tried this answer but didn't work for me.
最满意答案
最简单的方法是使用语言类Drupal添加到body元素。 检查你的页面html,看看body标签有哪些类。 应该有一些类似于“i18n-de”的类(在这种情况下是德语)。 然后你可以使用它来设置body标签内的任何元素(基本上所有元素),如:
body.i18n-de div#header {.some css.} body.i18n-en div#header {.some other css.}The simplest way is to use language class Drupal is adding to body element. Check your page html and see what classes body tag has. There should be some class similar to "i18n-de" (in this case for German). Then you can use it to style differently any element inside body tag (basically all of them), like:
body.i18n-de div#header {.some css.} body.i18n-en div#header {.some other css.}更多推荐
发布评论