Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.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
在iframe中,自定义字体不起作用?_Iframe_Font Family - Fatal编程技术网

在iframe中,自定义字体不起作用?

在iframe中,自定义字体不起作用?,iframe,font-family,Iframe,Font Family,我面临一个问题,我给了自定义字体。它正在网站上运行。我已经给了一个iframe在网站上,在这个iframe自定义字体不工作,它正在加载新的罗马字体系列计时器。如果有人提出建议,请分享解决方法。CSS规则(如自定义字体设置)不会通过iframe级联。一种可能是使用新的无缝属性: <!doctype html> <style> /* custom font etc. */ </style> <iframe seamless src="http://www.e

我面临一个问题,我给了自定义字体。它正在网站上运行。我已经给了一个iframe在网站上,在这个iframe自定义字体不工作,它正在加载新的罗马字体系列计时器。如果有人提出建议,请分享解决方法。

CSS规则(如自定义字体设置)不会通过iframe级联。一种可能是使用新的
无缝
属性:

<!doctype html>
<style>
/* custom font etc. */
</style>
<iframe seamless src="http://www.example.org/"></iframe>
<!-- now your styles are inherited by the embed website -->

/*自定义字体等*/

不幸的是,该属性目前对浏览器的支持非常差,因此一个更简单的解决方案是在iframe中显示的页面中包含相关样式表。

您不能从iframe外部更改css。@JimiGautam正如我提到的,并非所有浏览器都支持
无缝
属性,这就是为什么它可能不起作用。只需在iframe中显示的文档中包含样式表。