css滑鼠移至上方時為其他標籤設定樣式

來源:互聯網
上載者:User

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>滑鼠移至上方時為其他標籤設定樣式</title>
<style type="text/css">
.a{ width:80px;height:24px;text-align:center;line-height:24px;background:red;}
.a:hover a{color:#fff;text-decoration:none;}
</style>
</head>
<body>
    <div class="a">
        <a href="#">test</a>
    </div>
</body>
</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.