html - 我可以让固定文本在横幅之后消失吗?
问题描述
目前,我的横幅中有一个固定的文本和一个固定的导航栏。我希望文字在横幅图像之后消失。导航栏可以在整个页面上保持固定。但我希望文字在图像之后消失!有没有办法为固定元素设置边界。否则有没有办法在背景上获取固定文本,这样它就不会出现在我的主要内容上,而是出现在它的后面。多谢你们!!
body {
margin: 0;
padding: 0;
font: font-family: myriad-pro, sans-serif;
position:relative;
}
.text {
display: inline-block;
width: 100%;
text-align: center;
position:fixed;
top: 200px;
color: white;
border-style: none;
border: 0;
padding: 0;
margin: 0;
opacity: 80%;
font-family: myriad-pro, sans-serif;
font-weight: 100;
font-size: 35px;
font-style: italic;
border-style: none;
}
#text2{
margin-left: 200px;
font-weight: 100;
opacity: 60%;
margin-top: -40px;
}
.image {
filter: brightness(40%);
}
li:hover{
background-color: darkgrey;
}
li {
list-style-type: none;
color: aqua;
float: right;
padding-left: 5px;
padding-right: 5px;
margin-top: 17px;
font-family: myriad-pro, sans-serif;
font-weight: lighter;
}
a.list{
color: black;
text-decoration: none;
white-space: 20px;
}
.navbar {
display: inline-block;
text-align: right;
background-color: white;
opacity: 53%;
width: 100%;
position:static;
top: 20%;
border-style: none;
position: fixed;
top: 25px;
width: 100%;
white-space: 80px;
z-index: 9;
}
.logo{
text-align: left;
padding-left: 20px;
margin-top: -11px;
}
.marcel{
display: block;
background-color: antiquewhite;
margin: 250px 250px;
text-align: center;
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<link rel="stylesheet" href="./test.css">
<link rel="stylesheet" href="https://use.typekit.net/wbf4zoi.css">
<title>Edusolut</title>
</head>
<body>
<nav class="navbar">
<ul>
<li><a class="list" href="#"> Home</a></li>
<li><a class="list" href="#"> Service</a></li>
<li><a class="list" href="#"> Contact</a></li>
<li><a class="list" href="#"> Training</a></li>
</ul>
<div class="logo">
<img src="logo3.png" width="120px" />
</div>
</nav>
<div role="banner">
<div class="image">
<img src="./computer-2565478_1280.jpg" alt="computer" height="630rem" width="100%">
</div>
<div class="text">
<h1>Edusolut</h1>
<div id="text2">
<p>Your Education Solution.</p>
</div>
</div>
</div>
</body>
<body id="main">
<div class = "marcel" >
<img src="./marcel.png">
<h3> Netwerk en Trainig consultancy</h3>
解决方案
推荐阅读
- qt - 如何在树莓派运行时将 Qt 程序与其他 C++ 程序连接起来?
- python - li.append(i) vs tu = tu + (i,)
- c# - 使用源生成器构建 C# dotnet
- r - 在 R 中按找到它们的字符串列出模式
- linux - 无法修复 NGINX 502:Digital Ocean 液滴上的网关错误 - Ubuntu 20.04
- excel - Power Query 如何使具有多个值的表成为使用 OR 的参数
- python - Telegram bot 根据请求获取相同的数据
- c# - 如何获取列表中的第二个元素
- flutter - 从多个小部件更新 AppBar 中的购物车徽章计数器
- php - 在 wordpress 插件中使用 ajax 将数据插入自定义表的问题