gpt4 book ai didi

html - 如何在 div 悬停时显示相应的标签

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

您好,我有一个圆形 div,我希望仅使用 css 一些文本在悬停时显示并在鼠标移出时消失例如,如果有一个圆形 div,我希望标签 say home 在悬停时出现在它的右侧并在鼠标移开时消失

我的按钮代码是-

 .cbp-fbscroller > nav a {
display: block;
position: relative;
z-index: 9999;
color: transparent;
width: 26px;
height: 26px;
outline: none;
margin: 25px 0;
border-radius: 50%;
border: 4px solid #fff;
}

.no-touch .cbp-fbscroller > nav a:hover {
background: rgba(255,255,255,0.4);
}

.cbp-fbscroller > nav a.cbp-fbcurrent {
background: #fff;
}

最佳答案

你可以使用这个代码......

.circle {
width: 150px;
height: 150px;
border: 5px solid whitesmoke;
border-radius: 50%;
position: relative;
background:url('http://download.jqueryui.com/themeroller/images/ui- bg_flat_100_555_40x100.png');
}
.circle:before {
position: absolute;
top: 10px;
left: 10px;
right: 10px;
bottom: 10px;
background: whitesmoke;
border-radius: 50%;
content:"";
display: block;
}
.circle:hover span {
display:inline;
width: 0;
height: 0;
position: absolute;
top: 50%;
left:100%;
margin: -5px 0px -5px -25%;
padding: 5px 0px 5px 25%;
}
span
{
display:none;
}

演示:JSFIDDLE

关于html - 如何在 div 悬停时显示相应的标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19151861/

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