英文:
Custom / Google arabic font on wordpress
问题
我尝试安装自定义字体,也尝试了Google字体,但它没有在任何地方影响到我。屏幕截图显示它们的出现方式以及它们应该出现的方式。
/* 这是Google字体 */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700&display=swap');
/* 这是自定义字体 */
@font-face {
font-family: 'kanun_arltmedium';
font-weight: 500;
font-style: normal;
src: url('webfonts/kanun_arlt-medium-webfont.woff2') format('woff2'), url('webfonts/kanun_arlt-medium-webfont.woff') format('woff'), url('webfonts/kanun-arlt-medium.ttf') format('truetype');
}
@font-face {
font-family: 'kanun_arltregular';
font-style: normal;
font-weight: normal;
font-display: auto;
src: url('webfonts/kanun_arlt-regular-webfont.woff2') format('woff2'), url('webfonts/kanun_arlt-regular-webfont.woff') format('woff'), url('webfonts/kanun-arlt-regular.ttf') format('truetype');
}
@font-face {
font-family: 'kanun_arltbold';
font-style: normal;
font-weight: bold;
font-display: auto;
src: url('webfonts/kanun_arlt-bold-webfont.woff2') format('woff2'), url('webfonts/kanun_arlt-bold-webfont.woff') format('woff'), url('webfonts/kanun-arlt-bold.ttf') format('truetype');
}
/* 结束自定义字体CSS */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] span.elementor-heading-title.elementor-size-default, h1 {
font-family: 'Vazirmatn', sans-serif !important;
}
<h1>مرحباً بكم في ربع قرن للموسيقى</h1>
英文:
I've tried installing a custom font and also tried google Fonts but it's not affecting me anywhere. screenshots are given of how they are appearing and how they should appear.
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-css -->
/*this is google font*/
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700&display=swap');
/* this is custom font */
@font-face {
font-family: 'kanun_arltmedium';
font-weight: 500;
font-style: normal;
src: url('webfonts/kanun_arlt-medium-webfont.woff2') format('woff2'), url('webfonts/kanun_arlt-medium-webfont.woff') format('woff'), url('webfonts/kanun-arlt-medium.ttf') format('truetype');
}
@font-face {
font-family: 'kanun_arltregular';
font-style: normal;
font-weight: normal;
font-display: auto;
src: url('webfonts/kanun_arlt-regular-webfont.woff2') format('woff2'), url('webfonts/kanun_arlt-regular-webfont.woff') format('woff'), url('webfonts/kanun-arlt-regular.ttf') format('truetype');
}
@font-face {
font-family: 'kanun_arltbold';
font-style: normal;
font-weight: bold;
font-display: auto;
src: url('webfonts/kanun_arlt-bold-webfont.woff2') format('woff2'), url('webfonts/kanun_arlt-bold-webfont.woff') format('woff'), url('webfonts/kanun-arlt-bold.ttf') format('truetype');
}
/* End Custom Fonts CSS */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] span.elementor-heading-title.elementor-size-default, h1 {
font-family: 'Vazirmatn', sans-serif !important;
}
<!-- language: lang-html -->
<h1>مرحباً بكم في ربع قرن للموسيقى</h1>
<!-- end snippet -->
答案1
得分: 0
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700;800;900&display=swap');
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] span.elementor-heading-title.elementor-size-default, h1 {
font-family: 'Vazirmatn', sans-serif;
}
@import should be at the first of the file
<details>
<summary>英文:</summary>
Put the following in style
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700;800;900&display=swap');
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] span.elementor-heading-title.elementor-size-default, h1 {
font-family: 'Vazirmatn', sans-serif;
}
@import should be at the first of the file
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论