zoukankan      html  css  js  c++  java
  • CSS3入门之字体

    在CSS3之前,必须使用已经在用户计算机上安装好的字体,给Web设计带来很大的局限性。现在,通过CSS3,Web设计师可以使用他们喜欢的任意字体。

    1、@font-face引入网络字体

    Firefox、Chrome、Safari 以及 Opera 支持 .ttf (True Type Fonts) 和 .otf (OpenType Fonts) 类型的字体。

    Internet Explorer 9+ 支持新的 @font-face 规则,但是仅支持 .eot 类型的字体 (Embedded OpenType)。

    不兼容IE8,IE8-。

    示例:

    <style>
        @font-face {
            font-family: SentyPaperCut;
            src:url(http://hstarcdn.github.io/fonts/SentyPaperCut.ttf);
        }
        @font-face {
            font-family:SentyCreamPuff;
            src:url(http://hstarcdn.github.io/fonts/SentyCreamPuff.otf);
        }
        .font1,.font2{
          font-size: 50px;
        }
        .font1{
          color: red;
          font-family: SentyTEA-Platinum;
        }
        .font2{
          color: blue;
          font-family: SentyCreamPuff;
        }
    </style>
    
    <span class="font1">
      自定义字体演示
    </span>
    <span class="font2">
      自定义字体演示
    </span>
  • 相关阅读:
    HDU2203
    POJ3616
    堆排序
    POJ1386+欧拉回路
    快速排序(实现)
    HDU3549+FordFulkerson
    POJ2155
    POJ1195
    mysql案例~关于linux服务器本身的优化问题
    mysql案例~mysql主从复制延迟概总
  • 原文地址:https://www.cnblogs.com/yourName/p/8522641.html
Copyright © 2011-2022 走看看