gpt4 book ai didi

html - 将信息图标定位在其他图像之上

转载 作者:行者123 更新时间:2023-11-28 12:45:43 25 4
gpt4 key购买 nike

我正在努力实现与此人相同的目标:css positioning of an info-note on the top of an icon

但在我的例子中,我在其他图像之上有信息图标,请参阅此 jsBin:http://jsbin.com/usuyu3/5

我想将信息图标放置在表格标题的左下角,因此位置相对相同。

当我在 .tooltip 类上使用 position:relative 时,会显示信息图标,但我无法将它们放在表格顶部。

当使用 position:absolute 时,我可以在表格顶部获得 1 个图标,但其他图标不可见。

我该如何解决这个问题?

最佳答案

这是工作的:

<!DOCTYPE html>
<html>
<head>
<style>
a.tooltip .tooltip {
position: absolute;
top: -1.1em;
left: 0;
display: none;
color: black;
white-space: nowrap;
}
a.tooltip {
text-decoration: none;
position: absolute;
margin-top: -345px !important;
margin-left: 5px;
padding-right: 152px;
}
a.tooltip:hover .tooltip {
display: block;
}
.overflow {
margin:124px 0px 0px 0px;
min-height:213px;
color: #8C8C8B;
width: 100%;
}

.overflow p {
padding-top: 0px;
}

#onside { padding-top: 7px;}
#logopakketten {position: relative; z-index: 1; margin-left: 158px; margin-top: -332px; overflow: visible;}

.column {
display:block;
float:left;
}
</style>

</head>
<body>
<div class="overflow">
<div id="onside">
<p>Lorem ipsum:</p>
<p>Lorem ipsum:</p>
<p>Lorem ipsum:</p>
<p>Lorem ipsum:</p>
<p>Lorem ipsum:</p>
<p>Lorem ipsum:</p>
<p>Lorem ipsum:</p>
</div>
</div>
<div id="logopakketten">
<div class="column">
<img src="http://rickgommers.nl/geoffrey/wp-content/themes/interio_child/images/logopakketten/test.png" alt="" />
<a href="#" class="tooltip"><img src="http://rickgommers.nl/geoffrey/wp-content/themes/interio_child/images/infoicoontje.png" alt="" /><span class="tooltip">Tooltip 1</span></a>
</div>
<div class="column">
<img src="http://rickgommers.nl/geoffrey/wp-content/themes/interio_child/images/logopakketten/test.png" alt="" />
<a href="#" class="tooltip"><img src="http://rickgommers.nl/geoffrey/wp-content/themes/interio_child/images/infoicoontje.png" alt="" /><span class="tooltip">Tooltip 2</span></a>
</div>
<div class="column">
<img src="http://rickgommers.nl/geoffrey/wp-content/themes/interio_child/images/logopakketten/test.png" alt="" />
<a href="#" class="tooltip"><img src="http://rickgommers.nl/geoffrey/wp-content/themes/interio_child/images/infoicoontje.png" alt="" /><span class="tooltip">Tooltip 3</span></a>
</div>
<div class="column">
<img src="http://rickgommers.nl/geoffrey/wp-content/themes/interio_child/images/logopakketten/test.png" alt="" />
<a href="#" class="tooltip"><img src="http://rickgommers.nl/geoffrey/wp-content/themes/interio_child/images/infoicoontje.png" alt="" /><span class="tooltip">Tooltip 4</span></a>
</div>

</div>

</body>
</html>

关于html - 将信息图标定位在其他图像之上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17374969/

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