Web课外练习7

html 复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>照片墙</title>
    <style>
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: #f0f0f0;
        }
        .photo-wall {
            background-color: antiquewhite;
            padding: 60px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
            display: flex table-column;
            justify-content: center;
            margin-top: 30px;
        }
        .tit {
            text-align: center;
            width: 100%;
            font-size: larger;
        }
        .photo {
            width:110px;
            margin: -5px;
            transition: transform 0.5s;
            cursor: pointer;
            border: 5px solid white;
        }
        #img1{
            transform: rotate(-10deg);
        }
        #img2 {
            transform: rotate(8deg);
        }
        #img3{
            transform: rotate(-6deg);
        }
        #img4{
            transform: rotate(10deg);
        }
        #img5 {
            transform: rotate(-8deg);
        }
        #img1:hover {
            transform: rotate(0deg) scale(1.3);
        }
        #img2:hover {
            transform: rotate(0deg) scale(1.3);
        }
        #img3:hover {
            transform: rotate(0deg) scale(1.3);
        }
        #img4:hover {
            transform: rotate(0deg) scale(1.3);
        }
        #img5:hover {
            transform: rotate(0deg) scale(1.3);
        }

    </style>
</head>
<body>
    <div class="photo-wall">
        <div class="tit">照片墙</div>
        <div class="box">
            <img src="C:\Users\Ghost\Desktop\Web\1713942115636.jpg"  class="photo" id="img1">
            <img src="C:\Users\Ghost\Desktop\Web\Image_1711450117523.jpg"  class="photo" id="img2">
            <img src="C:\Users\Ghost\Desktop\Web\Image_1711450126632.jpg"  class="photo" id="img3">
            <br>
            <img src="C:\Users\Ghost\Desktop\Web\Image_1711450173275.jpg"  class="photo" id="img4">
            <img src="C:\Users\Ghost\Desktop\Web\mmexport1711450780605.jpg"  class="photo" id="img5">
        </div>
    </div>
</body>
</html>

效果图

旋转属性参考博客:css元素转换(旋转函数、rotateX 和 rotateY 的使用、移动函数、缩放函数、过渡、动画)详解_css rotate-CSDN博客

相关推荐
漂流瓶jz13 小时前
快速定位源码问题:SourceMap的生成/使用/文件格式与历史
前端·javascript·前端工程化
samroom13 小时前
iframe实战:跨域通信与安全隔离
前端·安全
fury_12313 小时前
vue3:数组的.includes方法怎么使用
前端·javascript·vue.js
weixin_4050233713 小时前
包资源管理器NPM 使用
前端·npm·node.js
宁&沉沦14 小时前
Cursor 科技感的登录页面提示词
前端·javascript·vue.js
Dragonir14 小时前
React+Three.js 实现 Apple 2025 热成像 logo
前端·javascript·html·three.js·页面特效
peachSoda715 小时前
封装一个不同跳转方式的通用方法(跳转外部链接,跳转其他小程序,跳转半屏小程序)
前端·javascript·微信小程序·小程序
@PHARAOH15 小时前
HOW - 浏览器兼容(含 Safari)
前端·safari
undefined在掘金3904115 小时前
flutter 仿商场_首页
前端