亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么在瀏覽器中運行時我的網頁底部有空白?

為什么在瀏覽器中運行時我的網頁底部有空白?

慕的地8271018 2024-01-11 10:37:37
我在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>
查看完整描述

1 回答

?
互換的青春

TA貢獻1797條經驗 獲得超6個贊

是的,我觀察到底部出現空白。這是因為 body 標簽內的元素沒有占用完整的可用 body 大小。

https://img1.sycdn.imooc.com/659f54a80001013019151081.jpg

元素高度為 body- 722 header- 104 .showcase- 251 enter code here .info-bar- 201 .testimonials- ~71 footer- ~62


底部的空白區域是視口的剩余區域。如果你縮小瀏覽器,空白就會消失。


要解決此問題,您可以在正文中使用以下 css。


body {

font-family: Tahoma, Verdana, Segoe;

font-size: 15px;

line-height: 1.5;

padding: 0;

margin: 0;

background-color: #ffffff;

/* Add below lines*/

display: flex;

flex-direction: column;

align-items: stretch;

}


查看完整回答
反對 回復 2024-01-11
  • 1 回答
  • 0 關注
  • 271 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號