我正在尝试创建一个带有剔除文本的导航栏。我已经使用<div>
带有<p>
内部的 a 测试了这段代码,并让它正常工作。但是,当我尝试<nav>
使用相同的技术设置元素的样式时,文本保持黑色而不是透明。
HTML:
<body>
<nav class="flex-row">
<a class="flex-center" href="index.html" class="logo"><img src="images/logo-no-bkg.png" style="height:15vh;"></a>
<a class="flex-center" href="about.html">about</a>
<a class="flex-center" href="team.html">team</a>
<a class="flex-center" href="services.html">services</a>
<a class="flex-center" href="contact.html">contact</a>
</nav>
<div class="background">
<div class="text flex-center">TEST</p>
</div>
</body>
CSS:
body {
width: 100vw;
height: 100vh;
background-image: url("../images/nyc.jpeg");
background-position: top;
background-size: cover;
}
nav {
justify-content: space-around;
color: black;
background: rgba(255,255,255,0.5);
mix-blend-mode: screen;
}
nav a {
height: 20vh;
width: 20vw;
font-family: 'Bebas Neue', cursive;
font-size: 50px;
align-self: stretch;
position: relative;
text-align: center;
}
.background {
width: 100vw;
height: 100vh;
background-image: url('../images/nyc.jpeg');
}
.text {
height: 100%;
margin: 10px solid;
font-family: 'Bebas Neue', cursive;
font-size: 400px;
color: black;
background: rgba(255,255,255,0.5);
mix-blend-mode: screen;
}
这是<nav>
条形图和我的 test的图像<div>
,<div>
正常工作而<nav>
条形图不工作: