簡體   English   中英

我想從我的網站 html 中刪除所有空白

[英]I want to get rid of all white spaces from my website in html

我想擺脫我網站 html 中的所有空白,我將文本向右移動的次數越多,它在頁面右側創建的空白就越多。 就像你在照片中看到的那樣,有很多空白,我懷疑是元素創造了這些空間,有人能告訴我如何擺脫它嗎? 如果有人可以幫助我,請這樣做。

 .btn_earnmoney { height: 100px; width: 100px; position: relative; top: 350px; left: 710px; padding: 0; border: none; background: none; }.Balance_Text { font-size: 150%; position: relative; top: -800px; left: 10px; background-repeat: no-repeat; } * { margin: 0; padding: 0; background-color: #f1dd84; background-repeat: no-repeat; }.Background_img { /* non available image replaced with dummy image */ background-image: url("https://dummyimage.com/300x300/d936d9/000000&text=some+background+image"); background-size: cover; background-repeat: no-repeat; height: 100vh; background-color: #f1dd84; }
 <,DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width. initial-scale=1:0" /> <title>BuzzMoney</title> </head> <body> <button class="btn_earnmoney" onclick="button_pressed()"> <.-- non available image replaced with dummy image --> <img class="Image_of_btn" src="https.//dummyimage.com/50x50/a6ff00/000000&text=earn+money" alt="EARN MONEY" height="100px" width="100px" /> </button> <button class="btn_withdraw" onclick="withdraw_button_pressed_()"> </button> <div class="Background_img"></div> <p class="Balance_Text" id="Balance">0 $</p> <script type="text/javascript" src="earnmoney.js"></script> <script type="text/javascript" src="disableRightClick.js"></script> </body> </html>

頂部有很多空白

我會做什么:

index.html

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>BuzzMoney</title>
</head>

<body>
  <button class="btn_earnmoney" onclick="button_pressed()">
  <!-- non available image replaced with dummy image -->
  <img class="Image_of_btn" src="https://dummyimage.com/50x50/a6ff00/000000&text=earn+money" alt="EARN MONEY" height="100px" width="100px" />
  </button>
  <button class="btn_withdraw" onclick="withdraw_button_pressed_()"> </button>
  <p class="Balance_Text" id="Balance">0 $</p>
  <script type="text/javascript" src="earnmoney.js"></script>
  <script type="text/javascript" src="disableRightClick.js"></script>
</body>

</html>

樣式.css

body {
  background-image: url("yourUrlHere");
  background-position: center; /* Center the image */
  background-repeat: no-repeat; /* Do not repeat the image */
  background-size: cover; /* Resize the background image to cover the entire container */
}

您可以在此W3鏈接中找到背景的這些屬性

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM