【发布时间】:2015-10-07 12:18:54
【问题描述】:
.tooltip {
display: block;
margin: 50px;
position: relative;
transition: 10s linear all;
width: 100px;
}
.tooltip:after,
.tooltip:before {
transition: 10s linear all
}
.tooltip:before {
z-index: 99;
top: 100%;
right: 50000px;
position: absolute;
margin-top: -12px
}
.tooltip:after {
background: #FCE0BA;
top: 100%;
right: 50000px;
position: absolute;
z-index: 98;
width: 100px
}
.tooltip:hover:before {
border: solid;
border-color: #FCE0BA transparent;
border-width: 0px 6px 12px 6px;
content: "";
right: 50%;
margin-top: -12px
}
.tooltip:hover:after {
background: #FCE0BA;
color: #559bd9;
content: attr(title);
right: 20%;
padding: 6px;
font-size: 18px;
line-height: 1;
max-height: 999999px
}
<span class="tooltip" title="Lorem ipsum!">Hover me</div>
我正在尝试为正确的位置创建过渡,
如你所见,它有一个非常大的正确值,然后是我需要的那个,
但由于某种原因,过渡不会动画,
你知道我错过了什么吗?
【问题讨论】:
-
只有少数浏览器支持伪元素的过渡,另外,你应该订购过渡的简写,因为它必须是
标签: css css-transitions