为了账号安全,请及时绑定邮箱和手机立即绑定

为什么在我的 html head 标签中添加 google font 链接后我的网页会抖动?

为什么在我的 html head 标签中添加 google font 链接后我的网页会抖动?

HUWWW 2024-01-11 10:37:07
我在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>
查看完整描述

2 回答

?
拉风的咖菲猫

TA贡献1995条经验 获得超2个赞

感谢您的回答。我刚刚用一种方法解决了我的问题。因为我正在使用 VS Code。我设置了自动保存选项。自动保存延迟选项设置为 100 毫秒。当我将其转换为 1000 毫秒时,它可以正常工作,并且页面不会晃动。



查看完整回答
反对 回复 2024-01-11
?
Qyouu

TA贡献1786条经验 获得超11个赞

这可能是因为当您键入 CSS 时,它会暂时无效,直到您完成正在键入的规则。由于您使用的是实时预览扩展程序,而 CSS 无效,因此不会应用规则,因此您将看到页面外观的更改。



查看完整回答
反对 回复 2024-01-11
  • 2 回答
  • 0 关注
  • 40 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信