R
R
RedSmoke_smr2019-04-11 15:23:06
css
RedSmoke_smr, 2019-04-11 15:23:06

Why is the connected Open Sans Bold font not showing up?

Good afternoon!
Can you please tell me why the connected Open Sans Bold font is not displayed on my site?
I downloaded all the fonts, copied them to the fonts folder, then in CSS via font-face I connected two downloaded fonts, these are Open Sans Regular and Open Sans Bold. Regular is perfectly displayed and its style is noticeable, but when I write a bold style instead, it is not displayed, instead the usual standard font is shown.
Please help me understand the issue
Code at the beginning of the CSS file:

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

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

Connection to the block:
body {
  color: #000000;
  font-family: 'Open Sans Bold', sans-serif; //и этот не отображается, а если поменяю на Regular то все норм
  font-size: 15px;
  line-height: 24px;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Usachov, 2019-04-11
@RedSmoke_smr

Firstly, it is better to specify the family once and operate only with the style. Something like that:

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

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

Secondly, it is worth checking the paths to the font files.
The usual style is displayed normally for you, most likely due to the fact that this style is installed in the system.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question