首页 > 解决方案 > 为什么在我的 html 头标签中添加 google 字体链接后我的网页会抖动?

问题描述

我在 Vs 代码中创建了一个网页。然后我从google-font中选择一种字体并将其链接嵌入到 HTML 的 head 标签中。然后在 CSS 中添加字体系列。它工作正常。当我在实时服务器扩展中测试网页时。我注意到每当我在 CSS 中写一个字符时,页面都会 抖动很多。当我停止编写代码时,震动停止。在摇动期间字体变得更大,更小,更暗等无缘无故,虽然我没有做任何关于字体的事情。这背后的问题是什么?如何停止这种震动?

body{
font-family: 'Girassol', cursive;
font-size:25px;
}
<!DOCTYPE html>
<html>
  <head>
    <title>Dropdown Menu design</title>
    <link
      href="https://fonts.googleapis.com/css2?family=Girassol&display=swap"
      rel="stylesheet"
    />
    <link rel="stylesheet" href="indexstyle.css" />
    <script src="try.js"></script>
  </head>
  <body>
    <p>
      The University was established as compensation for the annulment of the
      1905 Partition of Bengal. The partition had established East Bengal and
      Assam as a separate province, with Dhaka as its capital. However, the
      partition was abolished in 1911. In 1913, public opinion was solicited
      before the university scheme was given its final shape, and the Secretary
      of State approved it in December 1913.[1] The first vice-chancellor of the
      university was Philip Joseph Hartog, who had been academic registrar of
      the University of London for 17 years.[
    </p>
  </body>
</html>

标签: htmlcsswebfonts

解决方案


感谢您的回答。我刚刚使用一种方法解决了我的问题。当我使用 vs 代码时。我设置了一个自动保存选项。自动保存延迟选项设置为 100 毫秒。当我将其转换为 1000 毫秒时,它可以在不晃动页面的情况下工作。


推荐阅读