【问题标题】:Source sans pro font in html [duplicate]html中的源sans pro字体[重复]
【发布时间】:2016-05-14 05:20:57
【问题描述】:

我想在我的 HTML 网站的 CSS 的 font-family 属性中使用 google 的“source sans pro”字体。我使用 Bootstrap 作为前端框架。

https://www.google.com/fonts/specimen/Source+Sans+Pro

我怎样才能做到这一点? 我必须将文件包含到我的 html 网站中吗?

感谢您的帮助!

【问题讨论】:

    标签: css html twitter-bootstrap


    【解决方案1】:

    在您网站的head 部分添加此字符串:

    <link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro' rel='stylesheet' type='text/css'>
    

    那就用这个字体吧:

    h1 {
      font-family: 'Source Sans Pro', sans-serif;
    }
    

    【讨论】:

      【解决方案2】:

      说明在您显示的页面顶部的链接中给出。 https://www.google.com/fonts#UsePlace:use/Collection:Source+Sans+Pro

      您将其包含在页面的头部:

      <link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro' rel='stylesheet' type='text/css'>
      

      并在您的 CSS 中指定字体系列。

      element {
          font-family: "Source Sans Pro"
      ]
      

      【讨论】:

        【解决方案3】:

        The fonts

        您可以选择所需的字体并获得链接: 对于 HTML

        https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,200,900italic,900,700italic,700,600italic,600,400italic,300italic,300,200italic' rel='stylesheet' type= '文本/css'>

        将此链接粘贴到您的

        然后在你的 css 中使用它

        font-family: 'Source Sans Pro', sans-serif;
        

        像这样的

        .class{
            font-family: 'Source Sans Pro', sans-serif;
        }
        

        【讨论】:

          猜你喜欢
          • 2017-02-01
          • 2021-08-13
          • 1970-01-01
          • 2017-02-01
          • 2015-06-16
          • 2016-08-08
          • 2016-10-16
          • 1970-01-01
          相关资源
          最近更新 更多