<div class="sideBar"> <div> <div class="tips">Online customer service</div> <ul class="list"> <li>QQ:48846110</li> <li>QQ:48846110</li> <li>QQ:48846110</li> <li>QQ:48846110</li> </ul> </div> </div>
<a href=" tencent://message/?uin=48846110& ; Site= Beautiful theme & Menu=yes">48846110</a>
.tips{ box-sizing:border-box; width:40px; padding:10px 10px; height:120px; line-height:25px; }
.sideBar .list { list-style:none; width:120px; padding:0; margin:0; }
.sideBar { position:fixed ; }
.sideBar>div { position:relative; }
.tips{ position:absolute; left:-40px; top:50px; }
.sideBar { position:fixed; right:-122px; top:250px; }
.sideBar:hover { right:0; }
<! doctype html> <html> <head> <meta charset="utf-8"> <title>Teach you to create a side bar floating online customer service with CSS</title> <style> .sideBar { position:fixed; right:-122px; top:250px; background-color:#ffffff; border:#45B6F7 solid 1px; transition:right 0.5s; } .sideBar:hover { right:0; } .sideBar>div { position:relative; } .sideBar .tips { position:absolute; height:120px; line-height:25px; background-color:#45B6F7; width:40px; left:-40px; top:50px; text-align:center; box-sizing:border-box; padding:10px 10px; border-top-left-radius:5px; border-bottom-left-radius:5px; font-weight:bold; color:#ffffff; } .sideBar .list { list-style:none; padding:0; width:120px; margin:0; } .sideBar .list>li { cursor: pointer; padding:15px; border-top:#45B6F7 solid 1px; } .sideBar .list>li:hover { background-color:#45B6F7; color:#ffffff; } .sideBar .list>li:first-child { border-top:none; } </style> </head> <body> <div class="sideBar"> <div> <div class="tips">Online customer service</div> <ul class="list"> <li>QQ:48846110</li> <li>QQ:48846110</li> <li>QQ:48846110</li> <li>QQ:48846110</li> </ul> </div> </div> </body> </html>