Language Reference, Font-family -


there 3 basic languages used on website. put lang="en" in html tag. in css file write following:

body {   ...  font-family: 'open sans';  font-size: 10pt;  ... } 

so, if text on website in english either russian uses web font called open sans. , works ok.

now want make when write text in armenian use web font arian amu, doesn't work way: font-family: 'open sans', 'ariam amu';

in css, write

:lang(hy) {     font-family: 'arian amu';     font-size: 10.5pt;     line-height: 18px; } 

and put lang="hy" in p tags when whole text in armenian.

the question is, how can make if language russian or english, writes in open sans 10pt , when it's armenian, ariam amu 10.5pt , line-height of 18px.

the pseudo-class :lang has more specificity element selector body. may cause issues when 2 rules conflict, in case. try specifying conflicting rules same specificity:

:lang(en), :lang(ru) {     font-family: 'open sans', sans-serif;     font-size: 10pt; }  :lang(hy) {     font-family: 'ariam amu';     font-size: 10.5pt;     line-height: 18px; } 

see jsfiddle.

you can learn more css specificity reading these articles:


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -