html - 如何将子域 Assets 用于另一个子域

标签 html css .htaccess font-face

我的 Wamp 服务器中有两个子域

在我的 Asset.localhost 中。我有 css 文件夹,在这个文件夹中我有 style.css 文件,其中包含 @fontFace 如下代码:

@font-face {
    font-family: 'yekan';
    src: url('../fonts/Yekan-modified.eot');
    src: url('../fonts/Yekan-modified.eot#iefix') format('embedded-opentype'),
         url('../fonts/Yekan-modified.woff') format('woff'),
         url('../fonts/Yekan-modified.ttf') format('truetype'),
         url('../fonts/Yekan-modified.svg#CartoGothicStdBook') format('svg');
    font-weight: normal;
    font-style: normal;
}

现在我想将此文件(style.css) 用于http://management.localhost/dashbord/index.php

CSS 代码也可以,但字体不起作用! 我的错误在哪里?

谢谢...

最佳答案

只需在您的 css 文件中指定完整的字体路径

@font-face {
    font-family: 'yekan';
    src: url('http://asset.localhost/admin/fonts/Yekan-modified.eot');
    src: url('http://asset.localhost/admin/fonts/Yekan-modified.eot#iefix') format('embedded-opentype'),
     url('http://asset.localhost/admin/fontsYekan-modified.woff') format('woff'),
     url('http://asset.localhost/admin/fontsYekan-modified.ttf') format('truetype'),
     url('http://asset.localhost/admin/fontsYekan-modified.svg#CartoGothicStdBook') format('svg');
    font-weight: normal;
    font-style: normal;
}

因为 .. 指定了它的父目录,但是你的字体在其他目录中,所以指定完整路径将解决它

关于html - 如何将子域 Assets 用于另一个子域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40133046/

相关文章:

php - 通过 MySQL_Connect 访问 MySQL 数据库时发生内部服务器错误

javascript - 无法让 vimeo 视频与 fancybox 一起使用 - 我觉得我已经尝试了一切

html - 我需要使过滤器按钮与菜单对齐并使用 bootstrap 修改它的 css。我是 bootstrap 的新手所以无法弄清楚

javascript - 使用 CSS3 过渡将元素移动到新位置

apache - htaccess If ... Else始终选择Else

linux - SubDomain.DOMAIN.COM 在浏览器地址栏中保持原样 - .htaccess/mod_rewrite

html - 如何用css斜划线

javascript - 如何让不同高度的html div float 起来2

actionscript-3 - actionscript 样式表中的行高

html - 输入和选择字段的长度不同