我在Vs代碼中創(chuàng)建了一個網(wǎng)頁。然后我從google-font中選擇一種字體并將其鏈接嵌入HTML 的 head 標(biāo)簽中。然后在 CSS 中添加字體系列。它工作正常。當(dāng)我在實時服務(wù)器擴(kuò)展中測試網(wǎng)頁時。我注意到每當(dāng)我在 CSS 中寫一個字符時,頁面 就會晃動很大。當(dāng)我停止編寫代碼時,震動就會停止。在搖動過程中,字體無緣無故地變得更大、更小、更暗等,盡管我沒有對字體做任何事情。這背后的問題是什么?如何停止這種晃動?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 回答

拉風(fēng)的咖菲貓
TA貢獻(xiàn)1995條經(jīng)驗 獲得超2個贊
感謝您的回答。我剛剛用一種方法解決了我的問題。因為我正在使用 VS Code。我設(shè)置了自動保存選項。自動保存延遲選項設(shè)置為 100 毫秒。當(dāng)我將其轉(zhuǎn)換為 1000 毫秒時,它可以正常工作,并且頁面不會晃動。

Qyouu
TA貢獻(xiàn)1786條經(jīng)驗 獲得超11個贊
這可能是因為當(dāng)您鍵入 CSS 時,它會暫時無效,直到您完成正在鍵入的規(guī)則。由于您使用的是實時預(yù)覽擴(kuò)展程序,而 CSS 無效,因此不會應(yīng)用規(guī)則,因此您將看到頁面外觀的更改。
- 2 回答
- 0 關(guān)注
- 177 瀏覽
添加回答
舉報
0/150
提交
取消