首页 > 解决方案 > 有没有办法让我的 Google 字体代码适用于我的 HTML 代码?

问题描述

我正在尝试使用网站Neocities将字体添加到我的 HTML 代码中,当我添加字体时,我收到一个错误,提示Name entity expected. Got none.我已尝试搜索 p 如何修复此错误,但我有没运气。这是谷歌字体给我使用的代码:<link rel="preconnect" href="https://fonts.gstatic.com"> <link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">

标签: html

解决方案


那是因为链接或 src 中有一个 '&' 符号。HTML 不读取与符号等实体。您应该改用 %26 作为 & 符号。


推荐阅读