提问人:Sturmkater 提问时间:10/12/2023 更新时间:10/12/2023 访问量:9
视差滚动中的透明度不起作用
Transparency in parallax scrolling not working
问:
我尝试在徽标顶部获得一个具有 50% 透明背景的信息横幅,但不知何故透明度不起作用,我不知道如何修复它。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
margin: 0;
padding: 0;
font-family: sans-serif;
background-color: #00a0e6; /* Dark blue background color */
}
.parallax {
background-image: url('logo.svg'); /* Replace with your logo image */
/* Set a specific height */
min-height: 100vh; /* Set to 100% of the viewport height */
/* Create the parallax scrolling effect */
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: contain; /* Use contain for the logo to fit within the viewport */
max-width: 100%;
}
.text {
background: rgba(128, 128, 128, 0.5);
display: flex;
align-items: center;
justify-content: center;
text-align: center;
color: white;
height: 100vh; /* Set to 100% of the viewport height */
/* Make the .text container transparent over the background */
mix-blend-mode: normal;
}
</style>
</head>
<body>
<div class="parallax"></div>
<div class="text">
<div class="text-content">
<h1>This website is currently under construction.</h1>
<p>For the time being, please have a look at the old page <a href="http://www.lartedelcaffe.ch">lartedelcaffe.ch</a></p>
<p>Mail: <a href="mailto:[email protected]">Nicola</a></p>
</div>
</div>
</body>
</html>
我尝试使用 ChatGPT,但它只是搞砸了一切:-/
答: 暂无答案
评论