unicode-range 字体混搭(最近仿写其他网站发现了这个好东西)
最近一直在仿写其他的网站,突然发现了这个东西unicode-range,在百度之后发现了用处。
--------------------------------此处只是写一下用法-------------------------------------------------
- <html>
- <head>
- <title></title>
- <meta charset="utf-8">
- <style type="text/css">
- @font-face {
- font-family: 'mixFont';
- src: url('fonts/STHeiti-Light.ttf');
- unicode-range: U+4E00-9FCB;/*汉字字符集*/
- }
- @font-face {
- font-family: 'mixFont';
- src: url('fonts/HelveticaThin.ttf');
- }
- body{
- font-family:mixFont, Arial;
- font-size: 2rem;
- }
- @font-face {
- font-family: 'STHeiti';
- src: url('fonts/STHeiti-Light.ttf');
- }
- span{
- font-family: STHeiti;
- }
- </style>
- </head>
- <body>
- 这里是一些中文字符,These are couples of characters excepect Chinese.*&(%$(^651644'Hello world' <span> 'Hello world' so as to comparetion.</span>
- </body>
- </html>
还应该再看一下汉字字符集,现在大部分网站都已经选用了这种方法,避免了麻烦和繁琐的代码。
-----------------------------突然发现,自己学习东西有个东西记录点点滴滴真的很有意思---------------------------------------------
学习就是对于未知的东西给予的好奇心与耐心,一旦哪一个先被耗没,一切就结束了。


浙公网安备 33010602011771号