gpt4 book ai didi

html - 隐藏在其他框下方的对话泡泡 CSS 效果

转载 作者:太空宇宙 更新时间:2023-11-04 13:36:50 24 4
gpt4 key购买 nike

我是一名插画师,正在建立我的第一个作品集网站。

为了注释我的插图,当您将鼠标悬停在图像上时,我会出现隐藏的带有文本的对话气泡,这可以在此 demo 中看到(前两 block )

然而,对话泡泡总是在图像下方。

下面的图片也有 CSS 影响,可以放大它们,我不确定这是否会以任何方式影响语音气泡类。

如果有人可以向我指出我所缺少的使对话气泡出现在所有内容之上的代码,那将非常有帮助!

HTML:

<div id="wrapper2">

<div id="container"><a href="#" class="hoverbubble">Hover over me!<span>Hidden message here. Hidden message here. Hidden message here. Hidden message here. Hidden message here.Hidden message here. Hidden message here.Hidden message here.Hidden message here.</span></a></div>

<div id="container"><a href="#" class="hoverbubble"><img src="http://placekitten.com/180/160" class="hoverbubble"/><span>Hidden message here. Hidden message here. Hidden message here. Hidden message here. Hidden message here.Hidden message here. Hidden message here.Hidden message here.Hidden message here.</span></a></div>

<div id="bottem"><div class="scale scaleMe" id="container"></div><div class="scale scaleMe" id="container"></div>

</div>
</div>

类“hoverbubble”的 CSS

a.hoverbubble {
text-decoration: none;
}
a.hoverbubble span {
display: none;
position: absolute;
left: 0%;
top: 40%;
}
a.hoverbubble:hover span {
display: block;
position: absolute;
content: attr(title);
min-width: px;
width: 180px;
height: 100px;
top: 180px;
background: rgba(0,0,0,.8);
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
color: #fff;
font-size: 12px;
font-family: Arial, Helvetica, sans-serif;
padding: 10px;
}
a.hoverbubble:hover span:after {
position: absolute;
display: block;
content: "";
height: 0;
width: 0;
position: absolute;
bottom: 120px;
left: 90px;
border-top-width: 10px;
border-right-width: 10px;
border-bottom-width: 10px;
border-left-width: 10px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: transparent;
border-right-color: transparent;
border-bottom-color: rgba(0,0,0,.8);
border-left-color: transparent;
}

“比例”类的 CSS

.scale {
-webkit-transition: all .5s ease;
-moz-transition: all .5s ease;
-o-transition: all .5s ease;
transition: all .5s ease;
}
.scaleMe:hover {
transform: scale(1.2);
-webkit-transform: scale(1.2);
-ms-transform: scale(1.2);
-o-transform: scale(1.2);
-moz-transform: scale(1.2);
-webkit-box-shadow: 3px 3px 3px #666666;
-moz-box-shadow: 3px 3px 3px #666666;
-o-box-shadow: 3px 3px 3px #666666;
box-shadow: 3px 3px 3px #666666;
z-index: 1;
}

最佳答案

尝试将 z-index: 5 添加到 a.hoverbubble:hover span

关于html - 隐藏在其他框下方的对话泡泡 CSS 效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22992425/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com