簡體   English   中英

如何使我的擴展 html 背景完全透明

[英]How to make my extension html background full transparent

我有這個白色的小盒子,我想在開始添加我的 html 代碼之前讓他透明,我已經搜索了如何做到這一點,但我沒有找到任何類型的示例。

圖片:

在此處輸入圖像描述

html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-    scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="main.css">
  </head>
<body>
  <script type="text/javascript" src="./script.js" ></script>
</body>
</html>

CSS

* {
  padding:0;
  margin:0;
  vertical-align:baseline;
  list-style:none;
  border:0
}

html {
  background: transparent;
}

[編輯]

在此處輸入圖像描述

CSS

html, body {
  background: rgba(0, 0, 0, 0.01);
}

div {
  width: 300px;
  height: 300px;
  background: rgba(0, 0, 0, 0.1);
  /* border-radius: 16px; */
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(11.6px);
  -webkit-backdrop-filter: blur(11.6px);
  border: 1px solid rgba(0, 0, 0, 0.15);
}

html

<!-- I added this div -->
<div>
    TESTE
</div>

請改進您的問題。 如果你想用 CSS 讓一個元素透明,最簡單的方法是在顏色值的末尾加上0-9的數字,得到你想要的透明度,例如白色是#fff ,讓它透明實驗與#ffffff0#ffffff1#ffffff2 ,到9

暫無
暫無

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

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