你能用CSS让<abbr>元素的标题淡入吗?
我知道如何风格的标题,我在想,如果它是可能的动画以及。
我是说,当你在元素上空盘旋时,它突然出现了。我希望它慢慢淡入,并想知道它是否有可能在CSS中。JSFiddle
<abbr title="I want this to fade in">Hover over Me!</abbr>abbr {
position: relative;
border:none;
}
abbr:hover::after {
position: absolute;
height:auto;
width:475px;
bottom: -50px;
color:black !important;
left: 0;
display: block;
padding: 1em;
background: gold;
border-radius:2px;
content: attr(title);
-o-transition:.5s;
-ms-transition:.5s;
-moz-transition:.5s;
-webkit-transition:.5s;
}发布于 2014-05-18 20:37:08
您需要使用一个转换为数字的值:例如,opacity。演示
abbr:hover::after {
opacity:1;
}
abbr::after {
position: absolute;
opacity:0;
height:auto;
width:475px;
bottom: -50px;
color:black !important;
left: 0;
display: block;
padding: 1em;
background: gold;
border-radius:2px;
content: attr(title);
-o-transition:.5s;
-ms-transition:.5s;
-moz-transition:.5s;
-webkit-transition:.5s;
transition:1s;/* DO NOT FORGET THE REGULAR ONE */
}在演示中,伪已经存在,但在您悬停<abbr>之前是跨行的。
https://stackoverflow.com/questions/23726554
复制相似问题