- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我很难解决这个 z-index 问题,所以我想分享它并寻求帮助,以防有人也遇到这个问题。
发生了什么:当用户将鼠标悬停在每个 block 上时,每个工具提示都会显示,但不幸的是它显示在 block 下方,因此工具提示整体不可见。我有 CSS 方面的经验,但这对我来说真的很棘手。在此先感谢您的帮助!
.main-container .row {
width: 100%;
table-layout: fixed;
}
.row {
display: table;
table-layout: fixed;
width: 100%;
position: relative;
}
.main-container .row-inner {
position: relative;
display: table;
table-layout: fixed;
height: 100%;
min-width: 100%;
width: auto;
}
.main-container .row-container > .row-parent .row-child > .row-inner > div {
padding: 0px 0px 0px 36px;
}
.row div.column_child.pos-top, .row div.column_child.pos-top .uncell {
vertical-align: top;
}
.row .uncol {
display: block;
position: relative;
}
.row .uncoltable {
display: table;
table-layout: fixed;
position: relative;
width: 100%;
height: 100%;
}
.row .uncell {
display: table-cell;
position: relative;
height: 100%;
vertical-align: inherit;
border: 0;
}
.tooltips-wrapper .uncont {
position: relative;
}
.tooltips-wrapper .tooltip-title {
background: #fff;
padding: 32px 0;
}
.co-umime .uncode_text_column {
max-width: 910px;
margin: 0 auto;
}
.co-umime .tooltip {
display: none;
padding: 30px;
border-radius: 5px;
position: absolute;
top: 85%;
margin: 0 !important;
background: #fff;
left: 12%;
max-width: 480px;
width: 100%;
z-index: 1;
}
.co-umime .tooltip p {
text-align: left;
font-weight: 400;
color: #46454E;
font-size: 16px;
line-height: 22px;
padding: 0;
}
.tooltips-wrapper .tooltip-title p {
text-align: left;
padding-left: 86px;
color: #46454E;
font-size: 20px;
font-weight: bold;
line-height: 30px;
}
.tooltips-wrapper .tooltip-title p img {
vertical-align: middle;
line-height: 1;
position: absolute;
left: 29px;
top: 50%;
transform: translateY(-50%);
z-index: 0;
}
<div class="tooltips-wrapper vc_custom_1530264908310 row-internal row-container boomapps_vcrow">
<div class="row row-child">
<div class="row-inner" style="height: 95px; margin-bottom: -1px;">
<div class="pos-top pos-center align_left column_child col-lg-4 boomapps_vccolumn single-internal-gutter">
<div class="uncol style-light">
<div class="uncoltable">
<div class="uncell boomapps_vccolumn no-block-padding">
<div class="uncont">
<div class="uncode_text_column tooltip-title">
<p><img class="alignnone size-full wp-image-72965" src="/insightlab/wp-content/uploads/2018/06/lightbulb.png" alt="" width="35" height="37">Online deníčky</p>
</div>
<div class="uncode_text_column tooltip">
<p>Jde o kvalitativní výzkumnou metodu, kdy si lidé v delším časovém období zaznamenávají své zkušenosti a odpovídají na aktuální témata a otázky moderátora.</p>
<p>Do online deníčku má přístup jen účastník a moderátora. Je možné se dostat do velkého detailu, která není rušena interakcemi ostatních.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="pos-top pos-center align_left column_child col-lg-4 boomapps_vccolumn single-internal-gutter">
<div class="uncol style-light">
<div class="uncoltable">
<div class="uncell boomapps_vccolumn no-block-padding">
<div class="uncont">
<div class="uncode_text_column tooltip-title">
<p><img class="alignnone size-full wp-image-72965" src="/insightlab/wp-content/uploads/2018/06/lightbulb.png" alt="" width="35" height="37">Privátní panel</p>
</div>
<div class="uncode_text_column tooltip">
<p>Privátní on-line panel je souborem vašich zákazníků, kteří si na požádání rádi vyhradí čas, aby se spolupodíleli na vašem úspěchu. Nezáleží na tom, zda je zrovna oslovíte s dotazníkem, nebo je přizvete k diskuzi o designu nového produktu.</p>
<p>Jsou vaším poradním sborem, který vám pomáhá nastavit novou koncepci i vyladit drobné detaily.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="pos-top pos-center align_left column_child col-lg-4 boomapps_vccolumn single-internal-gutter">
<div class="uncol style-light">
<div class="uncoltable">
<div class="uncell boomapps_vccolumn no-block-padding">
<div class="uncont">
<div class="uncode_text_column tooltip-title">
<p><img class="alignnone size-full wp-image-72965" src="/insightlab/wp-content/uploads/2018/06/lightbulb.png" alt="" width="35" height="37">Výzkumné online komunity</p>
</div>
<div class="uncode_text_column tooltip">
<p>Pomohou vám poznat vaše zákazníky. Vytvoří efektivní a operativní model komunikace. Usnadní vám tak cestu k rychlé zpětné vazbě, ale také novým nápadům a inspiracím. Zákaznické komunity pomáhají přirozeně tvořit skupinu ambasadorů vaší značky.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
最佳答案
看来您的主要问题是堆叠顺序。您正在尝试建立一个嵌套的 div,它的 z-index 高于外部容器中的同级 div。
即
//index.html
<div class="sibling one">
<div class="child"></div>
</div>
<div class="sibling two">
<div class="child"></div>
</div>
//style.css
.sibling {
position: relative;
display: block;
width: 50%;
}
.child {
position: absolute;
}
.sibling.one .child {
z-index: 2;
}
.sibling.two .child {
z-index: 1;
}
问题在于,子级继承了父级的堆叠顺序。这意味着,无论提供的 z-index 是什么,它都不能堆叠在其父容器的下方。
因此,您有两个选择。您可以使工具提示将其 html 输出到所有提供的悬停容器上下文之外的外部容器中。
或者,您可以简单地制作一个 javascript,将您网站该部分中所有 .pos-top.column_child
元素的 z-index 设置为 0
, 只会使 pos-top.column_child
的 z-index 悬停到 1
。
所以像这样(使用 jquery):
function openToolTip( event ){
var el = $(event.currentTarget);
var otherEls = $('.tooltips-wrapper .pos-top.column_child') //the only way i could uniquely select those cells. You should probably try to name these in your html to better target them.
otherEls.css({zIndex:0});
el.css({zIndex:1});
}
function hideOtherRows( event ){
var el = $(event.currentTarget);
var otherEls = $('.tooltips-wrapper') ;
otherEls.css({zIndex:0});
el.css({zIndex:1});
}
$('[data-section=3] .pos-top.column_child').on("mouseover", openToolTip);
$('.tooltips-wrapper').on("mouseover", hideOtherRows);
将此粘贴到您网站的控制台中会产生我们期望的结果。自己试试吧。
这应该有助于理解堆叠上下文:
https://philipwalton.com/articles/what-no-one-told-you-about-z-index/ https://www.stevefenton.co.uk/2012/08/z-index-and-the-stacking-context/
关于css - Z-index 未按预期工作 - 文本显示在 block 下,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51991878/
我对java有点陌生,所以如果我犯了一个简单的错误,请原谅我,但我不确定我哪里出错了,我收到的错误是“预期的.class,预期的标识符,而不是声明, ';'预期的。”我尝试了不同的方法,并从这些方法中
This question already has answers here: chai test array equality doesn't work as expected (3个答案) 3年前
我正在学习 Java(对不起,我的英语很差,这不是我的母语),当我在 Eclipse (JavaSE-1.7) 中在我输入的每个“try”中执行“try-finally” block 时,会出现以下消
我收到两个错误,指出 token 上的语法错误,ConstructorHeaderName expected instead & token “(”上的语法错误,< expected 在线: mTM.
我找不到错误。 Eclipse 给我这个错误。每个 { } 都是匹配的。请帮忙。 Multiple markers at this line - Syntax error on token “)”,
代码: import java.awt.*; import javax.swing.*; import java.awt.event.*; public class DoubleIt extends
我正在用 python(Vs 代码)编写代码,但出现此错误: Expected ")" Pylance 错误发生在:def main() 我试着运行我的 main 并将它打印到我的屏幕上。我用谷歌搜
我正在尝试按照 documentation 中的建议使用异步函数。但我收到此错误 意外的 token ,预期 ( async function getMoviesFromApi() { try
Closed. This question does not meet Stack Overflow guidelines。它当前不接受答案。 想改善这个问题吗?更新问题,以便将其作为on-topic
Closed. This question does not meet Stack Overflow guidelines。它当前不接受答案。 想改善这个问题吗?更新问题,以便将其作为on-topic
第一行包含一个表示数组长度的整数p。第二行包含用空格分隔的整数,这些整数描述数组中的每个元素。第三行打印一个整数,指示负数组的数量。 package asgn3; import java.util.*
好的,我是初学者,我必须修复此 java 表达式语言代码才能在我的系统 (Windchill) 中工作,但看起来我在语法中遗漏了一些内容: LWCNormalizedObject lwc =
我无法编译我的程序! 我想我缺少一个花括号,但我怎么也看不出在哪里! import javax.swing.*; import java.awt.*;
我的 jQuery 代码有问题,我的 Firebug 向我发出警告:需要选择器。 这是代码: $("img[id$='_tick']").each(function() { $(this).c
我的新类(class) Fountainofyouth 遇到了问题。尝试构建整个项目后,调试器显示 warning: extended initializer lists only available
我已经从 Java 转向 CPP,并且正在努力围绕构造构造函数链进行思考,我认为这是我的问题的根源。 我的头文件如下: public: GuidedTour(); GuidedTour(string
鉴于以下 for(var i=0; i< data.cats.length; i++) list += buildCategories(data.cats[i]); jsLint 告诉我 Expect
我有这个 json,但 Visual Studio Code 在标题中给了我警告。 [ { "title": "Book A", "imageUrl": "https:
我正在尝试编写一个有条件地禁用四个特殊成员函数(复制构造、移动构造、复制赋值和移动赋值)的包装类,下面是我用于测试目的的快速草稿: enum class special_member : uint8_
所以我用 F# 编写了一个非常简单的程序,它应该对 1000 以下的所有 3 和 5 的倍数求和: [1..999] |> List.filter (fun x -> x % 3 = 0 || x %
我是一名优秀的程序员,十分优秀!