简体   繁体   中英

Applying custom font in css is not working?

I am trying to use a custom font for the headings on my site but I cannot get it to work. It is just displaying as default Times New Roman or something no matter what I try. Does anyone have any advice about what I can do to get this font to show?

<style>

@font-face {
font-family:"volcano";
src: url("/wp-content/themes/wp-bootstrap-4/assets/fonts/Volcano-King.ttf") format ("truetype"),
     url("/wp-content/themes/wp-bootstrap-4/assets/fonts/Volcano-King.woff") format ("woff");
}

h1 {
font-family: "volcano";
}

</style>

Looks like there's a missing :

Try this

<style>

@font-face {
font-family:"volcano";
src: url("/wp-content/themes/wp-bootstrap-4/assets/fonts/Volcano-King.ttf" format ("truetype"),
     url("/wp-content/themes/wp-bootstrap-4/assets/fonts/Volcano-King.woff" format ("woff");
}

h1 {
font-family: "volcano";
}

</style>
h1 {
font-family: "volcano";
}

add a colon between property-name and property-value

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM