apache:
方法1:
<Directory "/var/www/html"> <FilesMatch "\.(ttf|otf|eot)$"> Header set Access-Control-Allow-Origin "*" </FilesMatch> </Directory>
方法2:
在字体目录下写一个.htaccess
Header set Access-Control-Allow-Origin "*"
nginx:
location ~* \.(eot|ttf|woff)$ { add_header Access-Control-Allow-Origin *; }
关于浏览器字体跨域引用问题
时间: 2024-10-09 16:29:52