@ font-face适用于测试页面。但不适用于wordpress页面。
示例页
<html>
<style>
/*@font-face {
font-family: 'leb';
src: url(fonts/leb.ttf);
src: url('fonts/leb.eot?#iefix') format('embedded-opentype'),
url('fonts/leb.woff') format('woff'),
url('fonts/leb.ttf') format('truetype'),
url('fonts/leb.svg#leb-webfont') format('svg');
}*/
@font-face {
font-family: 'leb';
src: url('http://www.swaidanews.com/CMS/wp-content/uploads/fonts1/leb.ttf');
src: url('http://www.swaidanews.com/CMS/wp-content/uploads/fonts1/leb.eot');
src: url('http://www.swaidanews.com/CMS/wp-content/uploads/fonts1/leb.eot?#iefix') format('embedded-opentype'),
url('fonts/leb.woff') format('woff'),
url('http://www.swaidanews.com/CMS/wp-content/uploads/fonts1/leb.ttf') format('truetype'),
url('http://www.swaidanews.com/CMS/wp-content/uploads/fonts1/leb.svg#leb-webfont') format('svg');
}
body
{
font-family:leb;
}
</style>
<body>
<h1>White-cheeked Barbet (Megalaima viridis)</h1>
<p>
Order: Piciformes<br />
Family: Megalaimidae<br />
Genus: Megalaima
</p>
<h2>Megalaimidae - Asian Barbets</h2>
<div>The White-cheeked Barbet or Small Green Barbet (Megalaima viridis) has a distinctive supercilium and a broad white cheek stripe below the eye and is endemic to the forest areas of the Western Ghats and adjoining hills. </div>
<h2>Monotypic species (Endemic)</h2>
Megalaima viridis - Western Central & Southern West India, from South West Madhya Pradesh South to Palni, Nilgiri Hills, Bangalore area and Western Tamil Nadu.
<h3>Conservation status - Least Concern</h3>
<h2>Local Names</h2>
<p>Tamil - Chinna Kukkuruvaan (சின்ன குக்குறுவான்), Kattu Kukkuruvaan (காட்டுக் குக்குறுவான்), Hindi - Chhota basanta, Gujarat - Nano lilo kansa, Karnataka - Sonna hasira barbet, Malayalam - chinna kutturuvan</p>
<h2>White-cheeked Barbet (Megalaima viridis) Song/Call</h2>
http://youtu.be/6IpU_dLropY
</body>
</html>
此页面在Firefox中运行良好。但wordpress网站页面不...但在ie8和chrome中工作。
所以我寻找解决方案。但该示例页面的工作原理是什么?!
无论如何找到这个。
Access-Control-Allow-Origin: [web url]
<FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "http://example.com"
</IfModule>
</FilesMatch>
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/x-font-woff woff
现在sholud我在.htaccess文件中添加了这个。我只是添加了.htaccess文件的上面代码底部。该网站显示错误。
我的.htacess文件
RewriteEngine on
# -FrontPage-
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName swaidanews.com
AuthUserFile /home/swaidane/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/swaidane/public_html/_vti_pvt/service.grp
RewriteCond %{HTTP_REFERER} !^http://swaidanews.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://swaidanews.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.swaidanews.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.swaidanews.com$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ http://www.swaidanews.com [R,NC]
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^/?$ "http\:\/\/www\.swaidanews\.com\/site\/" [R=301,L]
如何添加代码??