Html 需要帮助从Azure将字体加载到网页中吗
我无法将我的字体从Azure加载到css/html中,使它们无法显示在我的页面上。这是我的密码Html 需要帮助从Azure将字体加载到网页中吗,html,css,azure,fonts,Html,Css,Azure,Fonts,我无法将我的字体从Azure加载到css/html中,使它们无法显示在我的页面上。这是我的密码 CSS:@font-face { font-family: 'DTLArgo-Bold'; src: url('../fonts/dtlargot-bold-webfont.eot'); src: url('../fonts/dtlargot-bold-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/dtlarg
CSS:@font-face {
font-family: 'DTLArgo-Bold';
src: url('../fonts/dtlargot-bold-webfont.eot');
src: url('../fonts/dtlargot-bold-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/dtlargot-bold-webfont.woff') format('woff'),
url('../fonts/dtlargot-bold-webfont.ttf') format('truetype'),
url('../fonts/dtlargot-bold-webfont.svg#dtl_argot_bold') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'dtl_argot_regular';
src: url('../fonts/dtlargot-webfont.eot');
src: url('../fonts/dtlargot-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/dtlargot-webfont.woff') format('woff'),
url('../fonts/dtlargot-webfont.ttf') format('truetype'),
url('../fonts/dtlargot-webfont.svg#dtl_argot_regular') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'DTLArgoT-Light';
src: url('../fonts/dtlargot-light-webfont.eot');
src: url('../fonts/dtlargot-light-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/dtlargot-light-webfont.woff') format('woff'),
url('../fonts/dtlargot-light-webfont.ttf') format('truetype'),
url('../fonts/dtlargot-light-webfont.svg#dtl_argot_light') format('svg');
font-weight: normal;
font-style: normal;
}
.font{
font-family: DTLArgoT-Light, Arial, sans-serif;
}
Azure Web.config:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="false" targetFramework="4.0" />
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<staticContent>
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
<remove fileExtension=".svg" />
<remove fileExtension=".eot" />
<remove fileExtension=".woff" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".woff" mimeType="application/x-woff" />
</staticContent>
</system.webServer>
</configuration>
CSS:@font-face{
字体系列:“DTLArgo粗体”;
src:url('../font/dtlargot-bold-webfont.eot');
src:url('../font/dtlargot bold webfont.eot?#iefix')格式('embedded-opentype'),
url('../fonts/dtlargot bold webfont.woff')格式('woff'),
url('../fonts/dtlargot bold webfont.ttf')格式('truetype'),
url('../fonts/dtlargot bold webfont.svg#dtl_argot_bold')格式('svg');
字体大小:正常;
字体风格:普通;
}
@字体{
字体系列:“dtl_argot_regular”;
src:url('../font/dtlargot-webfont.eot');
src:url('../font/dtlargot webfont.eot?#iefix')格式('embedded-opentype'),
url('../fonts/dtlargot webfont.woff')格式('woff'),
url('../fonts/dtlargot webfont.ttf')格式('truetype'),
url('../font/dtlargot webfont.svg#dtl_argot_regular')格式('svg');
字体大小:正常;
字体风格:普通;
}
@字体{
字体系列:“DTLArgoT Light”;
src:url('../font/dtlargot light webfont.eot');
src:url('../font/dtlargot light webfont.eot?#iefix')格式('embedded-opentype'),
url('../fonts/dtlargot light webfont.woff')格式('woff'),
url('../font/dtlargot light webfont.ttf')格式('truetype'),
url('../font/dtlargot light webfont.svg#dtl_argot_light')格式('svg');
字体大小:正常;
字体风格:普通;
}
.font{
字体系列:DTLArgoT Light、Arial、无衬线字体;
}
Azure Web.config:
我的文件结构是根目录,然后是两个文件夹,一个叫做字体(用于字体),另一个叫做css(用于css)。
任何帮助都将不胜感激。
谢谢 您使用的是Azure网站、Azure Webrole还是Azure虚拟机?您是否仅使用普通HTML、ASP.NET、PHP或Node进行开发 如果您在网站上,您必须更改位于网站的站点文件夹中名为
web.config
的文件
下面是一个非常简单的web.config示例,它注册WOFF文件以供Azure网站服务:
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension="woff" mimeType="application/font-woff" />
</staticContent>
</system.webServer>
</configuration>
您可能还需要为您使用的所有web字体扩展添加一个
mimeMap
。但是要小心选择正确的mime类型,因为它可能不起作用。例如,大多数用户添加了application/x-font-woff
,这可能对他们不起作用,因为application/font-woff
您使用的是Azure网站、Azure Webrole还是Azure虚拟机?您是否仅使用普通HTML、ASP.NET、PHP或Node进行开发
如果您在网站上,您必须更改位于网站的站点文件夹中名为web.config
的文件
下面是一个非常简单的web.config示例,它注册WOFF文件以供Azure网站服务:
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension="woff" mimeType="application/font-woff" />
</staticContent>
</system.webServer>
</configuration>
您可能还需要为您使用的所有web字体扩展添加一个
mimeMap
。但是要小心选择正确的mime类型,因为它可能不起作用。例如,大多数用户添加了application/x-font-woff
,这可能对他们不起作用,因为application/font-woff
您有没有可能捆绑CSS文件?在我升级的版本上没有,我计划捆绑它,但请检查这些字体的mime类型是否在承载应用程序的IIS中正确配置。这可能是这个问题的另一个原因。您可以将桌面远程连接到虚拟机中,并检查IIS管理控制台中的设置。是否有可能绑定CSS文件?不是在我提供的版本上,我计划将其绑定,但请检查这些字体的mime类型是否在承载应用程序的IIS中正确配置。这可能是这个问题的另一个原因。您可以将远程桌面安装到虚拟机中,并在IIS管理控制台中检查设置。