<div class="why-container">
<span>♥新人报道,顺便测试一下效果♥</span>
</div>
<style type="text/css">
.why-container {
background-color: blue;
opacity: 0.3;
position: absolute;
top: 20%;
width: 20%;
width: 300px;
height: 80px;
border-radius: 5px;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
}
.why-container:hover {
opacity: 1;
}
.why-container>span {
position: absolute;
top: 45%;
width: 100%;
text-align: center;
color: white;
}
</style>