html - How do you pull an item out of an overlay div?
问题描述
I need help. I created a div
to overlay the background image. Then I nested another div
with children span
in it. I'd like to pull out those span selectors on the lines so they're not obscured by their overlay. I've already used z-index
property on higher than overlay itself, but still all spans are hidden behind overlay. Maybe one of you can tell me what I'm doing wrong.
.breadcrumbs {
display: flex;
justify-content: left;
height: 100%;
align-items: center;
position: relative;
}
.breadcrumbs span {
font-size: 1.6rem;
color: white;
font-weight: 900;
font-style: italic;
letter-spacing: 1px;
position: absolute;
z-index: 10000;
}
.jumbotron {
min-height: 550px;
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
position: relative;
}
.overlay {
height: 100%;
width: 100%;
top: 0;
left: 0;
position: absolute;
background-color: black;
opacity: 0.66;
z-index: 10;
}
<div class="jumbotron" style="background-image: url('...');">
<div class="overlay">
<div class="breadcrumbs">
<span property="itemListElement" typeof="ListItem">
<a property="item" typeof="WebPage" title="..." href="..." class="post-root post post-post">
<span property="name">News Page</span>
</a>
<meta property="position" content="2">
</span>
</div>
</div>
</div>
解决方案
我不认为spans
是隐藏的。如果您的意思是它获得父级的不透明度而不是您必须重新排列结构..您的跨度必须在...之外...也许在放置在其顶部的元素.overlay
旁边的下一个“主”容器中.overlay
absolute
推荐阅读
- java - 要在 replaceAll 上使用的正则表达式创建
- javascript - 上传到特定文件夹 Firebase Storage NodeJS?
- c - 实现 AVL 树,但在插入大数据文件时出现段错误
- javascript - 如何在使用小尺寸标识符的同时唯一标识 DOM 元素
- javascript - 如何使用 .replace 从字符串中删除 ↵ 符号
- function - Dart / Flutter 与“对参数使用通用函数类型语法”(use_function_type_syntax_for_parameters)混淆
- python - python中熊猫的高效groupby()编码
- entity-relationship - 如何为不总是存在的 erd 实体创建属性
- python - Python 的双面不等式是如何工作的?为什么它不适用于 numpy 数组?
- reactjs - NextJS:从客户端或服务器端的另一个页面调用存储时,Redux 存储返回空