Demo
css
#purple {
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
text-align: center;
position:fixed;
height:10px;
left:-50px;
-webkit-transition: all .5s ease-in-out;
-moz-transition: all .5s ease-in-out;
-o-transition: all .5s ease-in-out;
x-index:999;
}
#purple:hover {
left:0px;
}
#purple:hover > div {
display: inline-block;
}
#red {
font-size: 11px;
background: #FEFEFE;
border:1px solid;
border-left:none;
padding:5px 0 5px 0;
width:100px;
height:10px;
x-index: 50;
}
#redtab {
-webkit-border-bottom-right-radius: 4px;
-webkit-border-bottom-left-radius: 0px;
-moz-border-radius-bottomright: 4px;
-moz-border-radius-bottomleft: 0px;
border-bottom-right-radius: 4px;
border-top-right-radius: 4px;
border-bottom-left-radius:0px;
border:1px solid;
border-left:none;
text-align: center;
height:10px;
padding:5px 0 5px 0;
width:25px;
font-size: 11px;
}
或者根据您的图像示例 Demo
css
#purple {
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
text-align: center;
position:fixed;
height:10px;
}
#purple:hover > div {
display: inline-block;
}
#red {
font-size: 11px;
background: #FEFEFE;
border:1px solid;
border-left:none;
padding:5px 0 5px 0;
width:100px;
height:10px;
x-index: 50;
}
#redtab {
-webkit-border-bottom-right-radius: 4px;
-webkit-border-bottom-left-radius: 0px;
-moz-border-radius-bottomright: 4px;
-moz-border-radius-bottomleft: 0px;
border-bottom-right-radius: 4px;
border-top-right-radius: 4px;
border-bottom-left-radius:0px;
border:1px solid;
border-left:none;
text-align: center;
height:10px;
padding:5px 0 5px 0;
width:25px;
font-size: 11px;
}