css之hover改變子項目和其他元素樣式

來源:互聯網
上載者:User
css之hover改變子項目和其他元素樣式

+表示下一級元素,>表示子項目

<!DOCTYPE html><html><head>    <meta charset="UTF-8">    <title></title></head><style>    #a {color : #FFFF00;}    #a:hover + #c{color : #00FF00;}    #a:hover + #c > #b{color : #0000FF;}</style><div id='a'>元素1</div><div id='c'>元素3    <div id='b'>元素2</div></div></html>
相關文章

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.