gpt4 book ai didi

twitter-bootstrap - MVC 4 Google 字体 - 内联网

转载 作者:行者123 更新时间:2023-12-04 09:00:49 24 4
gpt4 key购买 nike

我有一个 MVC4 4 Bootstrap 项目,它通过 Visual Studio 2010 在本地完美呈现,但是当我发布到用于 Intranet 的内部 IIS 时,我无法访问资源 http://fonts.googleapis.com/css ?family=Montserrat:400 所以有人可以解释我如何本地化此远程资源以便 IIS 在本地引用它。

任何帮助将不胜感激:-)

最佳答案

为了本地化 Google 字体,我将地址 http://fonts.googleapis.com/css?family=Montserrat:400 添加到我的浏览器地址栏,它会返回一个 css 文件。

@font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 400;
src: url(http://themes.googleusercontent.com/static/fonts/montserrat/v4/zhcz-_WihjSQC0oHJ9TCYFQlYEbsez9cZjKsNMjLOwM.eot);
src: local('Montserrat-Regular'), url(http://themes.googleusercontent.com/static/fonts/montserrat/v4/zhcz-_WihjSQC0oHJ9TCYFQlYEbsez9cZjKsNMjLOwM.eot) format('embedded-opentype'), url(http://themes.googleusercontent.com/static/fonts/montserrat/v4/zhcz-_WihjSQC0oHJ9TCYBsxEYwM7FgeyaSgU71cLG0.woff) format('woff');
}

然后我将上述 css 中的每个 url 添加到我的地址栏中,地址栏下载了相关的 .eot 和 .woff 文件。我只是用一个更符合逻辑的名称重命名了下载的文件,并将文件复制到/Content/fonts 目录中。

然后我将以下内容包含到我的 boostrap.css 文件中。

@font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 400;
src: url(fonts/montserrat-400.eot);
src: local('Montserrat-Regular'), url(fonts/montserrat-400.eot) format('embedded-opentype'), url(fonts/montserrat-400.woff) format('woff');
}

嘿,转眼间,所有字体都在内部 IIS 服务器上正确呈现。

关于twitter-bootstrap - MVC 4 Google 字体 - 内联网,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24576264/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com