D
D
denis_druid2019-05-03 10:35:54
css
denis_druid, 2019-05-03 10:35:54

How to include CSS fonts for https and http?

Hello. One project uses paid fonts, they are not available for free in Google fonts.
So. Recently, Google in the search results began to issue my site with https by default. The site has never used encryption, but oh well, Google knows better. Clients getting to the site saw it without CSS styles at all, they were not loaded for https.
The problem was solved by writing in meta tags when connecting css https:// instead of http://
CSS is now correctly loaded for two protocols. For both http and https.
But now there is such a problem: fonts are loaded only for https, and for http they don’t want to be hooked into any. How to decide?
All files are in place, the problem persists in all browsers.

<link href="https://mysite.com/style.css" rel="stylesheet" />

@font-face {
    font-family: 'Intro';
    src: url('//mysite.com/fonts/intro.eot');
    src: url('//mysite.com/fonts/intro.eot?#iefix') format('embedded-opentype'),
         url('//mysite.com/fonts/intro.woff') format('woff'),
         url('//mysite.com/fonts/intro.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
VeryLongAgoDid, 2019-05-03
@denis_druid

<link href="/style.css" rel="stylesheet" />

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question