gpt4 book ai didi

html - 使文本出现在悬停时

转载 作者:行者123 更新时间:2023-11-28 07:49:22 25 4
gpt4 key购买 nike

所以我需要在鼠标悬停在图像上时显示文本(如果这太难,则不必是链接)

html

<div id="con">
<div id="box1">
<p id="text1">
<a href="url">DESTINATION</a>SS
</p>
</div>

CSS

#con {
width:1024px;
height:670px;
background-color: #161717;
}

#box1 {
float:left;
font-size:25px;
width:388px;
height:477px;
background-image: url(media/trying1.png);
margin-left: 120px;
margin-top: 90px;

}

最佳答案

#con {
width:1024px;
height:670px;
background-color: #161717;
}

#box1 {
float:left;
font-size:25px;
width:388px;
height:477px;
background-image: url(media/trying1.png);
background: #ccc; /*for example*/
margin-left: 120px;
margin-top: 90px;

}

#text1{
opacity: 0;
transition: all 0.5s;
}
#box1:hover #text1{
opacity: 1;
}
<div id="con">
<div id="box1">
<p id="text1">
<a href="url">DESTINATION</a>SS
</p>
</div>

关于html - 使文本出现在悬停时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30523906/

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