hover事件1,滑鼠移入改變css樣式

來源:互聯網
上載者:User

html代碼:

<div class="change">

<p>內容</p>

</div>

css代碼:

.change p{

     color:#333;  //顏色為黑色

}

.change p:hover{

    color:red;  //滑鼠移入後顏色改變為紅色

}

這裡只是簡單的介紹一下hover的基本用法,主要是在要加入移入事件的標籤中加入hover事件,改變其css樣式如顏色,字型大小,位置,是否可見等等。還有通過移入一個標籤改變另一個標籤css樣式的方法在下一篇hover事件2中有介紹。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.