簡體   English   中英

字體不適用於 React 應用程序

[英]Font Not applying in React Application

我從谷歌 fonts 導入 fonts 並將 fonts 應用於索引頁面的所有元素。

但不應用這些 fonts

在索引中。html

<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">

索引.css

 .body {
  margin: 0;
  padding: 0;
  font-family: 'Press Start 2P'; }

看到這個作品,也許你正試圖改變 body 標簽,用body替換.body

 @import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap'); body { margin: 0; padding: 0; font-family: 'Press Start 2P', cursive; }
 Hello World!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM