问题描述
我在应用程式中使用 。
我已经按照指示定义了样式表:
< link href ='http://fonts.googleapis.com/css?family = Open + Sans:400,300,700'
rel ='stylesheet'type ='text / css'>
然后我在body selector上使用它:
body {
font-family:'Open Sans',sans-serif;
}
我还没有在其他地方定义字体系列。我假设,因为我已经定义在父,子元素将自动继承它。
但是,如果我打开检查员说在我的锚标记应用程序,并看到该标签的计算样式,我发现(Chrome最新)的渲染字体说Times New Roman 18 glyphs - 这是正确的吗?我期待它说Open Sans - Open Sans字体是不是被应用?
检查。它的工作对我来说很好!
I am using Google's Open Sans Font in my application.
I have defined the stylesheet as instructed:
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,700' rel='stylesheet' type='text/css'>
I then used it on the body selector as:
body { font-family: 'Open Sans', sans-serif; }
I have not defined font family anywhere else. I assume that since I have defined it at the parent, the child elements will automatically inherit it.
However, if I open up the inspector for say an anchor tag in my application and see the computed styles for that tag, I find that (Chrome Latest) the "Rendered Font" says "Times New Roman 18 glyphs" - Is this correct? I was expecting it to say "Open Sans" - Is the Open Sans font not being applied?
Check out the codepen link. Its working fine for me !
.open-sans-font{ font-family: 'Open Sans', sans-serif; }
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700" rel="stylesheet"> <div class="open-sans-font"> Stackoverflow rocks !!! </div>
这篇关于字体家庭打开Sans不被使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!