Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 我可以在我的tumblr博客上使用early access Google字体吗?_Html_Css_Tumblr - Fatal编程技术网

Html 我可以在我的tumblr博客上使用early access Google字体吗?

Html 我可以在我的tumblr博客上使用early access Google字体吗?,html,css,tumblr,Html,Css,Tumblr,我想使用此早期访问Google字体: 在我的tumblr博客上: 安装的主题是: 它确实支持谷歌字体,但我不知道如何使用早期访问谷歌字体 我尝试在之后添加此内容 http://fonts.googleapis.com/earlyaccess/notonastaliqurdudraft.css“rel='stylesheet'type='text/css'> 但是我不知道如何编辑下面的html来使用这种字体。下面是html中的代码 html { font: 175%/1.5

我想使用此早期访问Google字体:

在我的tumblr博客上:

安装的主题是:

它确实支持谷歌字体,但我不知道如何使用早期访问谷歌字体

我尝试在之后添加此内容 http://fonts.googleapis.com/earlyaccess/notonastaliqurdudraft.css“rel='stylesheet'type='text/css'>

但是我不知道如何编辑下面的html来使用这种字体。下面是html中的代码

html {
        font: 175%/1.5 {block:ifGoogleWebFont}{text:Google Web Font},{/block:ifGoogleWebFont} Avenir, Arial;
        -webkit-font-smoothing: antialiased;
    }
或者,我搜索了web,发现可以添加自定义CSS,因此我尝试将以下代码添加到“添加自定义CSS”中:

@import url(http://fonts.googleapis.com/earlyaccess/notonastaliqurdudraft.css);
body {
    margin: auto;
    margin-top: 2em;
    margin-bottom: 10em;
}
*[lang=ur] {
    direction: rtl;
    font-family: 'Noto Nastaliq Urdu Draft', serif;
}
但同样,一切似乎都不起作用

你现在可能已经注意到我根本不是一个编码员。我只是一个尝试处理html和CSS代码的临时博客


非常感谢您的帮助:)

要使用任何谷歌字体,只需使用网站上提供的代码片段即可。在您的情况下,将以下行添加到css文件中:

@import url(//fonts.googleapis.com/earlyaccess/notonastaliqurdudraft.css); 
你已经做到了

资料来源:

然后,示例代码仅将此字体应用于包含
lang
属性的元素,即

*[lang=ur]
被称为一个(CSS)选择器,*基本上是一个通配符,它选择所有元素-它被修改为只匹配某些元素

我猜:
您的html代码中没有
lang
属性,但我现在还不能确定,因为您还没有发布任何代码。

@Muneeb Ahmed,@elasticman是正确的

下面是谷歌字体早期访问的工作代码


@导入url(//fonts.googleapis.com/earlyaccess/notonastaliqurdu.css);
正文{
字体系列:“Noto Nastaliq Urdu”,衬线;
字体大小:36px;
颜色:蓝色;
文本对齐:右对齐;
}
㶕㶕㶕㶕㶕砭砭砭砭砭

非常感谢您!我添加了:@import url(//fonts.googleapis.com/earlyaccess/notonastaliqurdudraft.css);到tumblr编辑器中的“添加自定义CSS”框。然后我在主题的“谷歌网页字体”选项中添加了“Noto Nastaliq Urdu Draft”。现在它似乎正在发挥作用;至少,在主题编辑器中。当我点击“更新预览”按钮时,它会以Nastaliq字体显示所有内容。但是,一旦我退出编辑器,它会再次以以前的字体显示所有内容;我想,这是Arial。我应该在html的某个地方添加*[lang=ur]吗?我应该共享整个主题的html吗?这会有帮助吗?也许你可以修改你的文章,使其包含有效的链接(比如说,你的博客没有链接),这样我们就可以检查你的源代码了。但是,如果没有一个元素包含lang属性,它无论如何都不会工作。谢谢!我在帖子中添加了链接。你能看一下吗?大约一小时前我在你的网站上的时候,你把它做对了。也许你只是需要完全刷新你的页面(Firefox上的CTRL+F5)它是否在你的浏览器中显示Nastaliq字体?我刚刚在阅读了你的评论后安装了Firefox,但它似乎没有显示我想要的字体。
<html>
   <head>
      <style>
         @import url(//fonts.googleapis.com/earlyaccess/notonastaliqurdu.css);
         body {    
         font-family: 'Noto Nastaliq Urdu', serif;
         font-size: 36px;
         color: blue;
         text-align: right;
         }
      </style>
   </head>
   <body>
      <div>السلام علیکم<br>خوش آمدید  </div>
   </body>
</html>