【发布时间】:2019-10-15 10:02:14
【问题描述】:
我正在尝试在网站上建立团队部分。我有一个带有图像和人名的 Div。当我将鼠标悬停在名称上时,我希望有一个链接出现在其位置并将名称向上移动。 像这样的东西(团队部分): https://www.templatemonster.com/de/demo/55809.html
我尝试使用我在此处找到的解决方案并对其进行修改,但它并没有像我想要的那样工作:
#stuff {
position: absolute;
top: 100px;
opacity: 0.0;
-webkit-transition: all 500ms ease-in-out;
-moz-transition: all 500ms ease-in-out;
-ms-transition: all 500ms ease-in-out;
-o-transition: all 500ms ease-in-out;
transition: all 500ms ease-in-out;
}
#hover {
width:80px;
height:20px;
background-color:green;
margin-top: 50px;
margin-bottom:15px;
}
#hover:hover {
margin-top:25px;
margin-bottom: 25px;
opacity: 1.0;
}
#stuff:hover {
opacity: 1.0;
}
<link rel="stylesheet" type="text/css" href="main.css">
<section>
<div id="hover">Hover</div>
<div id="stuff">stuff</div>
是否有使用 CSS 和/或 Bootstrap 的简单解决方案?
【问题讨论】:
标签: html css hyperlink hover show