首页 > 代码库 > 纯css 构造的tip

纯css 构造的tip

css部分:

<style>
  .abc{
margin-top:20px;
}
span{
position:relative;
display: inline-block;
background: red;
}
span:hover{
cursor:pointer;
}
span:hover:before{
content:attr(data-abc);

border-radius: 3px;
color:#fff;
padding: 10px;
position:absolute;
left:100%;
top:-70%;
margin-left: 8px;
white-space: pre;

}
span:hover:after{
content: "";
position: absolute;
width:0%;
height: 0%;
border-right: 8px solid #2085C5;
border-top:8px solid transparent;
border-bottom: 8px solid transparent;

}
</style>

html部分

<div class="abc">
<span data-abc="癙標螖挝傚菓">划挝測埕垿試</span>

</div>

纯css 构造的tip