image.png 鼠标移入前

    image.png鼠标移入时显示的效果,

    1. <div class="parent">
    2. <div class="child">
    3. 移入显示我
    4. </div>
    5. </div>
    1. .parent {
    2. position: relative;
    3. width:100px;
    4. height:100px;
    5. background:blue;
    6. }
    7. .child {
    8. position: absolute;
    9. left:0;
    10. top:0;
    11. visibility: hidden;
    12. padding:5px;
    13. background:pink;
    14. border:1px solid #ccc;
    15. }
    16. .parent:hover > .child {
    17. visibility: visible;
    18. }