我尝试导入谷歌字体 这是代码:
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,300,600&subset=latin,cyrillic);
对于我使用不同font-weight
属性的不同元素
300,400,600
但不是那样做的 我错过了什么?
答案 0 :(得分:2)
它正常运行并没有问题。
在CodePen上查看此示例:http://codepen.io/mehrabi/pen/dGBrQN
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,300,600&subset=latin,cyrillic);
body{
font-family: 'Open Sans';
}
.noStyleP{
font-family: arial;
font-weight: noraml;
}
.p1{
font-weight: 300;
}
.p2{
font-weight: 400;
}
.p3{
font-weight: 600;
}
.p4{
font-weight: normal;
}
答案 1 :(得分:0)
它不起作用,因为你有拼写错误:
不是<?php echo ( !empty($_SESSION ['user']) ) ? $_SESSION ['user'] : 'USER'; ?>
,而是font-weigth
。
答案 2 :(得分:-1)
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,300,600&subset=latin,cyrillic);
应该是
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300,600&subset=latin,cyrillic);
由于错误的ssl证书,有时https://无法与Google一起使用。 试试吧!!!