gpt4 book ai didi

javascript - 悬停时的过渡图标

转载 作者:太空宇宙 更新时间:2023-11-03 23:15:45 25 4
gpt4 key购买 nike

我有这个代码

.pictos {
display: block;
height: 70px;
margin: 160px 0 30px;
padding: 0 17%;
width: 100%;
}
.pictos > div {
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.2);
border: 1px solid #fff;
border-radius: 50%;
display: table-row;
float: left;
height: 70px;
width: 70px;
margin: 0 0 0 50px;
}
.pictos a.standard:hover,
.pictos a.standard:focus {
background: url("http://s11.postimg.org/91k4hiqe7/standard.png") no-repeat scroll 50% -39px rgba(120, 182, 55, 1);
}
.pictos > div a {
border-radius: 50%;
display: inline-block;
height: 45px;
margin: 12px;
text-decoration: none;
text-indent: -9999px;
transition: all 500ms cubic-bezier(0.645, 0.045, 0.355, 1) 0s;
width: 45px;
}
/* Hide this */

.pictos > div .standard-hover {
border-radius: 50%;
display: inline-block;
height: 45px;
margin: 12px;
text-decoration: none;
text-indent: -9999px;
transition: all 500ms cubic-bezier(0.645, 0.045, 0.355, 1) 0s;
width: 45px;
}
.pictos > div:first-child {} .pictos a.standard {
background: url("http://s11.postimg.org/91k4hiqe7/standard.png") no-repeat scroll 50% 50% rgba(255, 255, 255, 1);
}
.pictos a.standard:hover span,
.pictos a.standard span:hover,
.pictos a.standard span:focus,
.pictos a.standard:focus span {
display: block;
opacity: 1;
}
.pictos a span::after {
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
border-color: #78b637 rgba(120, 182, 55, 0) rgba(120, 182, 55, 0);
border-image: none;
border-style: solid;
border-width: 6px;
content: " ";
height: 0;
left: 50%;
margin-left: -6px;
pointer-events: none;
position: absolute;
top: 100%;
width: 0;
}
.pictos a span {
background: none repeat scroll 0 0 #78b637;
border: medium none;
border-radius: 9px;
bottom: 50px;
color: #efefef;
font-family: "Montserrat-Regular", sans-serif;
font-size: 13px;
padding: 5px 0;
position: relative;
right: 77px;
text-align: center;
text-decoration: none;
text-indent: 0;
text-transform: uppercase;
width: 200px;
}
<div class="pictos">
<div>
<a href="#" class="standard">
<span>standard</span>
</a>
<a href="#" class="standard-hover">
<span>standard</span>
</a>
</div>
</div>

我想要的是当您将鼠标悬停在链接上时,一个白色图标电话(如 http://s30.postimg.org/3l9qho5h9/standard_hover.png )从底部出现到绿色圆圈。当第一个图标移动到顶部时会发生这种情况。

感谢您的帮助。

最佳答案

像这样?

.pictos {
display: block;
height: 70px;
margin: 160px 0 30px;
padding: 0 17%;
width: 100%;
}
.pictos > div {
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.2);
border: 1px solid #fff;
border-radius: 50%;
display: table-row;
float: left;
height: 70px;
width: 70px;
margin: 0 0 0 50px;
}

/* new stuff: */
.pictos a.standard {
background-repeat: no-repeat;
background-color: rgba(255, 255, 255, 1);
/* set two background images: */
background-image: url("http://s11.postimg.org/91k4hiqe7/standard.png"),
url(http://s30.postimg.org/3l9qho5h9/standard_hover.png);
/* set positioning for them both individually: */
background-position: 50% 50%, 50% 39px;
}
.pictos a.standard:hover,
.pictos a.standard:focus {
/* when hovering, change background-color and both of the background-positions: */
background-color: rgba(120, 182, 55, 1);
background-position: 50% -39px, 50% 50%;
}
/* end of new stuff, removed some other unnecessary rules also*/

.pictos > div a {
border-radius: 50%;
display: inline-block;
height: 45px;
margin: 12px;
text-decoration: none;
text-indent: -9999px;
transition: all 500ms cubic-bezier(0.645, 0.045, 0.355, 1) 0s;
width: 45px;
position:relative;
}
.pictos a.standard:hover span,
.pictos a.standard span:hover,
.pictos a.standard span:focus,
.pictos a.standard:focus span {
display: block;
opacity: 1;
}
.pictos a span::after {
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
border-color: #78b637 rgba(120, 182, 55, 0) rgba(120, 182, 55, 0);
border-image: none;
border-style: solid;
border-width: 6px;
content: " ";
height: 0;
left: 50%;
margin-left: -6px;
pointer-events: none;
position: absolute;
top: 100%;
width: 0;
}
.pictos a span {
background: none repeat scroll 0 0 #78b637;
border: medium none;
border-radius: 9px;
color: #efefef;
font-family: "Montserrat-Regular", sans-serif;
font-size: 13px;
padding: 5px 0;
position: relative;
text-align: center;
text-decoration: none;
text-indent: 0;
text-transform: uppercase;
width: 200px;
position:absolute;
top:-50px;
left:-77px;
opacity:0;
height:16px;
transition:opacity .4s;
}
<div class="pictos">
<div>
<a href="#" class="standard">
<span>standard</span>
</a>
</div>
</div>

关于javascript - 悬停时的过渡图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30646757/

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