图片旋转动画(网页制作)

下面是源代码,鼠标悬浮在图片上时图片翻转180度

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
    #piclist {
    float: left;
    width: 620px;
    height: 1050px;
    border: 3px solid #f70b65;
    background-color:cyan;
    border-radius: 10px;
}

.picbox {
    float: left;
    width: 300px;
    height: 510px;
    margin: 3px;
    border-radius: 20px;
    margin-top: 4px;
    -webkit-transform-style: preserve-3d;
    -moz-transform-style: preserve-3d;
    -ms-transform-style: preserve-3d;
    transform-style: preserve-3d;
    transition: 2s;
    position: relative;
}

.picbox:hover {
    transform: rotateY(180deg);
}

.face {
    width: 300px;
    height: 510px;
    position: absolute;
    border-radius: 20px;
    margin-top: 4px;
}

.front {
    background-size: cover;
}

.front img {
    border-radius: 20px;
    width: 300px;
    height: 510px;
    margin-top: 4px;
    margin:3px;
}

.back {
    background-color: rgba(0, 0, 0, 0.5);
    position: absolute;
    margin-top: 4px;
    margin:3px;
    border-radius: 20px;
    -webkit-transform: rotateY(180deg);
    -ms-stransform: rotateY(180deg);
    -o-transform: rotateY(180deg);

}

.back h3 {
    margin-top: 70px;
    font-size: 30px;
    color: white;
    text-align: center;
    font-family: "楷体";
}

.back h4 {
    margin-top: 20px;
    font-size: 25px;
    color: white;
    text-align: center;
    font-family: "楷体";
}

.back p {
    margin: 20px;
    font-size: 20px;
    color: white;
    text-align: center;
    font-family: "楷体";
}
    </style>
</head>
<body>
    <div id="piclist">
        <div class="picbox">
            <div class="face front"><img src="images/a5.jpg" alt=""></div>
            <div class="face back">
                <h3>书法</h3>
            </div>
        </div>
        <div class="picbox">
            <div class="face front"><img src="images/a11.jpg" alt=""></div>
            <div class="face back">
                <h3>故宫</h3>
            </div>
        </div>
        <div class="picbox">
            <div class="face front"><img src="images/a9.jpg" alt=""></div>
            <div class="face back">
                <h3>村居</h3>
                <h4>高鼎</h4>
                <p>草长莺飞二月天,</p>
                <p>扶梯杨柳醉春烟。</p>
                <p>儿童散学归来早,</p>
                <p>忙趁东风放纸鸢。</p>
            </div>
        </div>
        <div class="picbox">
            <div class="face front"><img src="images/a1.jpg" alt=""></div>
            <div class="face back">
                <h3>中国画</h3>
            </div>
        </div>
    </div>
</body>
</html>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值