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博客

相关推荐
LaughingZhu4 小时前
Product Hunt 每日热榜 | 2026-05-21
前端·人工智能·经验分享·chatgpt·html
怕浪猫4 小时前
Electron 开发实战(一):从零入门核心基础与环境搭建
前端·electron·ai编程
小鹏linux5 小时前
Ubuntu 22.04 部署开源免费具有精美现代web页面的Casdoor账号管理系统
linux·前端·ubuntu·开源·堡垒机
前端若水6 小时前
会话管理:创建、切换、删除对话历史
前端·人工智能·python·react.js
Bigger6 小时前
mini-cc:一个轻量级 AI 编程助手的诞生
前端·ai编程·claude
涵涵(互关)6 小时前
Naive-ui树型选择器只显示根节点
前端·ui·vue
BY组态6 小时前
Ricon组态系统最佳实践:从零开始构建物联网监控平台
前端·物联网·iot·web组态·组态
BY组态6 小时前
Ricon组态系统vs传统组态软件:为什么选择新一代Web组态平台
前端·物联网·iot·web组态·组态
SoaringHeart6 小时前
Flutter进阶:OverlayEntry 插入图层管理器 NOverlayZIndexManager
前端·flutter
放下华子我只抽RuiKe57 小时前
React 从入门到生产(四):自定义 Hook
前端·javascript·人工智能·深度学习·react.js·自然语言处理·前端框架