【发布时间】:2014-07-03 16:26:37
【问题描述】:
我有一个提示通过 :hover:before 在 css 中出现。唯一的问题是,当您将鼠标悬停在其上时,悬停的元素会消失,尽管会出现提示。请问谁知道我应该调整什么?
html:
<body>
<div class="content">
(...content of page)
</div>
</body>
jquery:
$('.content').prepend("<div id='arrowdown'><i tip='Return to story' class='fa fa-arrow-circle-o-down fa-2x vidclose'></i></div>");
css:
.vidclose {
color: lightgray;
z-index: 99;
position: fixed;
top: 20px;
right: 37px;
padding: 10px;
}
.vidclose:hover{
z-index: 99;
position: fixed;
top: 20px;
right: 37px;
padding: 10px;
color: #007fd4;
cursor: pointer;
}
.vidclose:hover:before {
content: attr(tip);
margin-right: 35px;
color: #007fd4;
font-family: "Muli", sans-serif;
font-size: 16px;
position: relative;
top: -6px;
}
【问题讨论】:
标签: css hover pseudo-element