【发布时间】:2019-02-13 11:14:28
【问题描述】:
我正在使用 wordpress woocommerce,这个文件 woocommerce/assets/css/_fonts.scss 是否有这个代码。
@font-face {
font-family: 'star';
src: url('../fonts/star.eot');
src: url('../fonts/star.eot?#iefix') format('embedded-opentype'),
url('../fonts/star.woff') format('woff'),
url('../fonts/star.ttf') format('truetype'),
url('../fonts/star.svg#star') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'WooCommerce';
src: url('../fonts/WooCommerce.eot');
src: url('../fonts/WooCommerce.eot?#iefix') format('embedded-opentype'),
url('../fonts/WooCommerce.woff') format('woff'),
url('../fonts/WooCommerce.ttf') format('truetype'),
url('../fonts/WooCommerce.svg#WooCommerce') format('svg');
font-weight: normal;
font-style: normal;
}
HTML 看起来像这样
<div class="star-rating">
<span style="width:100%">Rated
<strong class="rating">5.00</strong> out of 5</span>
</div>
我也有所有的字体文件。它在 Firefox 上运行良好,但在 chrome 上显示一些奇怪的字符?知道如何解决这个问题吗?
更新:
我在 chrome 上注意到了这些错误
CORS 策略已阻止从源“https:MY_URL”访问“https://bla.stackpathcdn.com/wp-content/plugins/woocommerce/assets/fonts/star.woff”处的字体:“Access-Control-Allow-Origin”标头包含多个值“*,” , 但只允许一个。 (索引):571 GET https://bla.stackpathcdn.com/wp-content/plugins/woocommerce/assets/fonts/star.woff net::ERR_FAILED (索引):1 CORS 策略已阻止从源“https:MY_URL”访问“https://bla.stackpathcdn.com/wp-content/plugins/woocommerce/assets/fonts/star.ttf”处的字体:“Access-Control-Allow-Origin”标头包含多个值“、*” , 但只允许一个。 (索引):657 GET https://bla.stackpathcdn.com/wp-content/plugins/woocommerce/assets/fonts/star.ttf net::ERR_FAILED
【问题讨论】:
标签: css google-chrome woocommerce