gpt4 book ai didi

html - 小图像上的工具提示

转载 作者:太空宇宙 更新时间:2023-11-04 01:43:25 26 4
gpt4 key购买 nike

我目前正准备建立我们的论坛,并且已经制作了一个验证系统,但想知道如何制作一个工具提示,就像 Facebook 那样。将鼠标悬停在支票图像上后,您将看到某种文本。

我已经尝试过一些方法来实现它,但没有成功。

GoDaddy's Facebook Page

HTML

img 标签包含这些:

data="BroHosting confirmed that this profile is an authentic for person, media, brand or company." class="tip"

CSS/样式

img:hover {
color: red;
position: relative;
}

img[data]:hover:after {
content: attr(data);
padding: 4px 8px;
color: rgba(0,0,0,0.5);
position: absolute;
left: 0;
top: 100%;
white-space: nowrap;
z-index: 2;
border-radius: 5px ;
background: rgba(0,0,0,0.5);
}

您是否有可能的解决方案或其他想法或建议?

最佳答案

.check {
position: relative;
display: inline-block;
background-color: #5890ff;
width: 12px;
height: 12px;
border-radius: 100%;
color: #000;
text-decoration: none;
}
.check:after {
content: attr(data-tooltip);
position: absolute;
top: 0;
left: 14px;
width: 100px;
background-color: #000;
color: #FFF;
font-family: Arial, sans-serif;
font-size: 14px;
padding: 5px;
opacity: 0;
pointer-events: none;
transition: opacity .3s ease-in-out;
will-change: opacity;
}

.check:hover:after {
opacity: 1;
pointer-events: auto;
}
<a href="#" class="check" data-tooltip="Lorem ipsum dolor sit amet"></a>

关于html - 小图像上的工具提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44973434/

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