M
M
Maxim Lesnikov2015-10-06 13:13:49
css
Maxim Lesnikov, 2015-10-06 13:13:49

How to connect fonts from another domain?

Good afternoon everyone. Asked a question.
1. There is a site with its own styles, etc.
2. This site has a subdomain. There is css with fonts of the form:

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


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

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

and so on ....
How to make it so that in the main style file (let's say style.css) just write the name of the fonts to certain divs and that's it. For example
font-family: 'Alexander';
Made in order not to litter the main style file with font codes. Since there are a lot of sites, and they don’t want to write fonts in styles every time.
I tried to connect inside the main style file like this:
@import url ("http://fonts.домен.ru/stylesheet.css" screen);

But when writing
font-family: 'Alexander', cursive; - Nothing happens

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Gregory, 2015-10-06
@grigruss

I saw the most optimal solution for connecting fonts only here . Get into the code and take a look. There, one of the CSS files is completely devoted to describing what fonts, in what format, and where to get them from.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question