【发布时间】:2014-11-28 17:50:49
【问题描述】:
我玩弄了我的标志并试图获得两个带有伪元素的悬停动画,我得到了一些结果,但有一些小故障(如果你将光标移动到标志下方一点,字母“B”,你会看到它),再次显示.logo a:after {content: "ogosavljev"} 或者如果你知道,如何避免第二个 div - 请分享它:)
或者用 jquery 对其进行动画处理?
HTML:
<!DOCTYPE html>
<body>
<div class="wrap">
<div class="logo">
<a href="/"><img src="http://s28.postimg.org/mqb5ghrwt/letter_B_blue_hover_me.png" /></a>
<div class="front">
<a href="/">front-end designer & developer</a>
</div>
</div>
</div>
</body>
CSS:
@import url(http://fonts.googleapis.com/css?family=Francois+One);
@import url(http://fonts.googleapis.com/css?family=Arbutus+Slab);
html {
font-family: 'Francois One', sans-serif;
font-size:17px;
line-height:1.5;
}
.wrap {
margin: 0 auto;
width: 960px;
}
.logo a {
font-family: 'Francois One', sans-serif;
color: white;
display: block;
position: relative;
text-transform: uppercase;
width: 650px;
}
.front a:after {
color: #6FCCE1;
}
.logo a:hover + .front a {
font-family: 'Arbutus Slab', serif;
background: none repeat scroll 0 0 transparent;
color: #6FCCE1;
transition-delay: 1.5s;
transition: all 1s ease 0.6s;
transform: translate(41%,-62px);
text-decoration: none;
text-transform: lowercase;
font-size: 1.25rem;
width: 650px;
}
.logo a:after {
background: none repeat scroll 0 0 transparent;
color: #71CCE2;
content: "ogosavljev";
display: inline-block;
font-size: 4.5rem;
height: 23px;
opacity: 0;
transform: translateY(0px);
vertical-align: top;
}
.logo a span, .logo a:after {
transition: all 0.2s ease 0s;
}
.logo a:hover:after, .logo a:focus:after {
opacity: 1;
transform: translate(-8%,-20px);
transition-delay: 0.5s;
}
你可以在fiddle看到的例子
【问题讨论】:
标签: jquery css animation hover transitions