왜 크롬을 표시하지 않 내@font-face?

0

질문

나는 로드 Hello World html 파일 크롬에서 95,으로 선언@글꼴 얼굴에서 로드된 구글 글꼴입니다. 글꼴을 올바르게 로드할 수 있는지 확인 네트워크 탭지만,어떤 이유로 내 div 으로 렌더링되는 시간.

무엇이 잘못된 것입니까?

<html>
<div style='font-family:OpenSans-Regular;'>
    Hello World!
</div>
</html>
<style>
    @font-face {
      font-family: OpenSans-Regular;
      font-style: normal;
      font-weight: 400;
      font-stretch: 100%;
      font-display: swap;
      src: url(https://fonts.gstatic.com/s/opensans/v27/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTSKmu0SC55K5gw.woff2) format('woff2');
    }
</style>
css font-face google-chrome html
2021-11-23 02:28:37
1

최고의 응답

1

에서 구글 글꼴 문서에사용해야 합니다 <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Font+Name"> 대신 그들을 쓴다.

귀하의 <style> 요소들은 잘못된 장소에서,아고다 <body> 소에서 HTML.

<html>
    <head>
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans">

        <style>
            * {
                font-family: "Open Sans";
            }
        </style>
    </head>
    <body>
        <div style='font-family:Open Sans'>
            Hello World!
        </div>
    </body>
</html>
2021-11-23 03:23:17

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................