Google webfont api
Web Font Test
我擦,业务从2C转向2B之后,需要研究下web font怎么运作的.翻看了下Google Font Quick Start,核心的代码如下
- Link font style
<link rel='stylesheet' type='text/css' href='http://fonts.googleapis.com/css?family=Tangerine'>
- Custom css selector
.font-css-test {
font-family: 'Tangerine', serif;
font-size: 48px;
text-shadow: 4px 4px 4px #aaa;
}
- Use css style.
<div class='font-css-test'>css style just load in detail pages. so you need click in it.</div>
Preview
"Everything around you that you call life was made up by people, & you can change it."
via Steve Jobs
The index page not load font style. plz click to preview.
Others
恰巧也研究了下Jekyll如何在子界面定义自己的样式.主要是用到了page
页头部的yaml
定义, 定义了两部分内容
css & style.
css: <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine">
style: |
<style>
.font-css-test {
font-family: 'Tangerine', serif;
font-size: 48px;
text-shadow: 4px 4px 4px #aaa;
}
</style>
在head.html
中添加如下两行代码,把子page页面中的自定义内容引用到head上
bwt: Jekyll 高亮自身的一些方法和属性.使用raw
& endraw