纯css 构造的tip

来源:互联网 发布:python base64解码 编辑:程序博客网 时间:2024/06/05 17:47

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);
background-color: #2085c5;
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>

0 0
原创粉丝点击