Trouble with font-face when uploading to hosting provider

My HTML website uses an otf font-face which works perfectly on my computer desktop. However, when I deployed it to the host, the font-face stopped working. I have attached an image to illustrate the difference.

I have ensured that all the files, both on my desktop and the host, are identical.

 <style>
        @font-face
        {
        font-family: proxima-nova-regular;
        src:    url("proxima-nova-regular.otf") format("opentype");
        }
        @font-face
        {
        font-family: proxima-nova-regular-italic;
        src:    url("proxima-nova-regular-italic.otf") format("opentype");
        }
        @font-face
        {
        font-family: proxima-nova-bold-regular;
        src:    url("proxima-nova-bold-regular.otf") format("opentype");
        }
        @font-face
        {
        font-family: proxima-nova-bold-regular-italic;
        src:    url("proxima-nova-bold-regular-italic.otf") format("opentype");
        }
        html, body
        {
            margin: 0px;
            padding: 0px;
        }

        .topbanner
        {
            width: 100%;
            height: 35px;
            background:rgb(35,35,35);
        }
        .topbannerinside
        {
            width: 200px;
            height: 35px;
            line-height: 35px;
            text-align: center;
            color: white;
            float: right;
            font-family: proxima-nova-regular;
        }
        .topbannerinside:hover
        {
            color: rgb(0, 232, 255);
        }
        .container
        {
            width: 1150px;
            height: 400px;
            background: rgb(250,250,250);
            border-radius: 50px;
            margin: auto;
            position: relative;
        }
        .header
        {
            width: 350px;
            height: 40px;
            font-family: proxima-nova-regular;
            font-size: 42px;
            top: 30px;
            left: 60px;
            position: absolute;
        }
        .subheader
        {
            width: 500px;
            height: 90px;
            font-family: proxima-nova-regular;
            font-size: 14px;
            position: absolute;
            left: 440px;
            top: 30px;
        }
        .selectregion
        {
            width: 460px;
            height: 280px;
            background-size: cover;
            background-image: url(samplescreen.png);
            border: dashed;
            border-color: black;
            border-width: 1px;
            position: absolute;
            left: 55px;
            top: 110px;
        } 

<!-- The rest of the code remains unchanged -->

Answer №1

A few options to consider:

  1. Have you identified the host server type (such as Apache, IIS, etc.)? It's possible that the OTF file isn't being served with the correct MIME type, preventing it from being recognized as a font.

  2. One suggestion is to enclose your 'font-family: "blah blah";' declaration in quotes for consistency.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Steps for adding an identifier to a background image

I need to convert this tag into a background image that can be altered by filters like opacity. The challenge lies in needing the ID of the image for JS purposes. <img id="image" class='img' src="adventure.jpg" height="80%" width="70%"> v ...

The main DIV is not adjusting to accommodate all the content within it

Although this question may have been raised countless times, I have not been able to find a satisfactory answer despite searching through numerous posts. Below is the code snippet in question: .feedCard { display: block; margin-left: 227px; margi ...

Incorporating Only XSD Files into an HTML Input Tag: A Simple Guide

Is there a way to restrict a file input element to only display XSD files? I attempted the following: <input type="file" accept="text/xsd" > Unfortunately, this method is not working as it still allows all file formats to be disp ...

Develop content specific to different geographic locations for a web application using PHP

I have been working on a PHP-based online shopping website but have not had much success with it. example.com After trying multiple approaches without success, I have decided to implement an admin feature for adding locations. For instance, if I add "Mad ...

Overlaying images responsively on top of each other

I have successfully achieved the result of displaying an image over another image using the following code: <div class="row"> <div class="col-lg-6 col-md-6 col-sm-12"> <div class="image-with-overlay"> <div clas ...

Display PHP Array data in a table on a webpage

I need help arranging the results from a MYSQL database into an HTML table. Right now, each item is displayed in one column per row. Here is my current code: <?php $catagory=$_GET["q"]; $con = mysql_connect("localhost","cl49-XXX","XXX"); if (!$con) ...

Exploring the process of setting a background image within a div tag

My goal was to design a clickable box that would redirect users to "#". I initially thought about using area maps within div or p tags, but unfortunately that wouldn't work. Does anyone have any suggestions for alternative solutions? ...

Getting the data value of a specific attribute while the active class is present in JQuery

My goal is to print out the data-attribute when an anchor tag has an active class using console.log Unfortunately, I always get a null value as output. I found guidance on this topic in a stackoverflow thread Below is my HTML code: $(document).ready(f ...

Displaying image behind bootstrap modal using Lightgallery js

Can anyone help me with an issue I'm having with previewing images using lightgallery js? The image is showing up behind the modal window. https://i.sstatic.net/FncZB.png I'm not sure why this is happening Here's the javascript code I am ...

Modal presentation in Bootstrap

I recently implemented a Bootstrap modal in my code, however, I'm having issues with the display. When the modal opens, it appears distorted. Can someone please help me figure out what's wrong with my code? I have included my HTML, CSS, and a scr ...

Can an HTML select box have a horizontal scroll bar added to it?

I am facing an issue with the following HTML code. <!DOCTYPE html> <html> <body> <select> <option value="volvo">Volvoooooooooooooooootooooooolargeeeeeeeeeeee</option> <option value="saab">Saab& ...

Issues with maintaining row column format in Bootstrap cards

I am currently facing an issue with the layout of my template: <center> <form class="site-form" action="{% url 'movie:recommend'%}" method="post"> {% csrf_token %} <input style="font-color:#000000;color: #008 ...

Toggle Visibility of Div Based on Matching Class Name When Clicked

Just delving into the world of jQuery and could use some guidance. Is there a way to show a div with a matching class when a specific button is clicked? For example, clicking on a button with the class '.project1' should display the corresponding ...

Tips for directing attention to a specific row with an input field in JavaScript

I duplicated a table and added an input field for users to search or focus on a specific row. However, there are two issues: When a user enters a row number, the table displays the wrong row - for example, if the user enters 15, the table shows row number ...

The Materialize CSS tabs are aligning vertically below each other, but functioning correctly upon refreshing the page

When using materialize css tabs, all the divs load one below the other on the initial page load. If I refresh the page, it starts behaving properly. <div class="row"> <div class="col s12"> <ul class="tabs"> <li class="tab col s ...

Struggling with extracting HTML page source with Java

My goal is to extract the HTML page source of a website in order to retrieve an email address. However, when I use a ripper or dumper tool, it only captures up to line 160 of the source code. I can manually access the webpage, right-click, and view the pag ...

What is the best way to eliminate all frames from the current windows using jQuery?

When transitioning to another page from my center frame, I need to ensure that the top and bottom frames are not visible in the new page. This will prevent my spinner or footer from showing up on the page I'm navigating to. Is it possible to achieve ...

Tips for incorporating a smooth fade in and out effect into images within a Bootstrap 5 carousel

I'm currently working with a Bootstrap 5 carousel and trying to implement a transition effect where clicking the "next" arrow will smoothly fade out the current image before fading in the next one. This is necessary because the images in my carousel v ...

Ways to center card components (rmwc) horizontally within a React application

Within my parent component: { this.state.projectList.map(data => <Item details = {data}/>) } Inside the child component Item render() { return ( <div style={{'width':'100%', 'tex ...

What is the best way to implement Bootstrap in Coda2?

I am new to web design and I am trying to incorporate Bootstrap into my HTML code using Coda2. Since I don't have access to a server, I am referencing the directory address of CSS files on my hard drive instead of a web address. Currently, the beginni ...