Topic: @font-face Don't show with wordpress with custom styles.css
aalvarado2998 free asked 1 year ago
Expected behavior
I need that at the moment of defining font-face the same ones appear with the class that I created.
Actual behavior
I defined the fonts in this way, and when I use the black-font class it does not show me the font I defined. I thought it was a problem with the linking of the style.css file inside the assets.php, but no, since I tested the "color" property with the text, and it does work.
Resources (screenshots, code snippets etc.)
.black-font{
font-family: 'Montserrat-Black' !important; }
@font-face {
font-family: 'Montserrat-Black', sans-serif;
src: url('wp-content/themes/mdb-sample-free-wp-theme/assets/fonts/Montserrat-Black.ttf');
}
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Opened
- ForumUser: Free
- Premium support: No
- Technology: MDB Standard
- MDB Version: MDB5 6.1.0
- Device: Dell Inspiration
- Browser: Chrome
- OS: Windows 10
- Provided sample code: No
- Provided link: No
Mateusz Lazaru staff commented 1 year ago
Check if it will work with remote url, for example:
src: url("https://mdn.github.io/css-examples/web-fonts/VeraSeBd.ttf");
If so, it will probably mean that the relative URL to the
monserrat-black.ttf
fromstyle.css
is invalid.