[英]Background color in <Body> isn't filling up the whole screen
我想在首頁設置背景顏色,所以我在正文部分添加了以下幾行:
<head>
<title>Speed_Test_Teleport</title>
</head>
<body style="height:100% ;margin:0 ;padding:0 ;background-color:#C6E2FF;">
<img src="GE_Logo3.png" style="width=350px; height:80px;">
<h1>SpeedTest to:</h1>
<div style="width: 100%; height: 24vh; text-align: center ; color:#8B0000 ; display:inline-block;">
<div style="width: 100%; height: 15px; text-align: center; font-family: palatino ;display: inline-block;"><font size="+3"><b>Teleport,Country </b></font>
但是,背景色只覆蓋了屏幕的 60%; 底部填充白色:
檢查其他帖子后,似乎高度、邊距和填充設置為正確的值,但如您所見,背景顏色只是部分填充了屏幕。
知道我缺少什么嗎?
如果需要更多信息,您可以在 index.html 中查看完整代碼:
將身體的高度設置為 100vh 而不是 100%。
<body style="height:100vh;margin:0;padding:0;background-color:#C6E2FF;">
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.