a:hover实例

这里写图片描述

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>CSS完成神奇创意的相框</title>
        <style type="text/css">
            * {
                text-align: center;
                border: 0;
                list-style: none;
            }

            body {
                font-size: 12px;
                font-family: Tahoma, Geneva, sans-serif;
                background: #000;
            }

            .photo {
                width: 404px;
                margin: 0 auto;
                border-left: solid 8px red;
                border-right: solid 8px red;
                background: #fff;
            }

            .photo h1 {
                font-size: 14px;
                color: #666;
                line-height: 40px;
            }

            .photo ul {
                margin: 0;
                padding: 0;
            }

            .photo li {
                position: relative;
                width: 400px;
                height: 300px;
                overflow: hidden;
            }


            .photo li a:hover span {
                display: block;
                text-align: center;
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                font-size: 40px;
                line-height: 300px;
                color: #f00;
                background: #000;
                filter: alpha(opacity=70);
                -moz-opacity: 0.;
                opacity: 0.7;
            }

            .magic1,
            .magic2,
            .magic3 {
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
            }

            .magic1 {
                background: url(01.png) no-repeat;
            }

            .magic2 {
                background: url(02.png) no-repeat;
            }


            a:hover {
                text-decoration: none;
            }
        </style>
    </head>

    <body>
        <div class="photo">
            <h1>Magic Photo Frame 神奇创意相框</h1>
            <ul>
                <li>
                    <a href="#"><img src="wall8.jpg" width="400" height="300" /><span>This is Magic!</span><em class="magic1">&nbsp;</em></a>
                </li>
                <li>
                    <a href="#"><img src="wall8.jpg" width="400" height="300" /><span>This is Magic!</span><em class="magic2">&nbsp;</em></a>
                </li>
            </ul>
        </div>
    </body>
</html>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值