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

相关推荐
沐言人生4 小时前
自媒体人的效率神器!监控、采集、下载、发布,这个免费开源工具全拿下!
前端·vue.js·后端
excel6 小时前
为什么 super 中能接收到 resolve 和 reject?
前端
Flynt8 小时前
AI 生成的界面,能放心点吗?我把 Google A2UI 的三层防线拆开测了一遍
前端·google·agent
前端混子8 小时前
我用 AI 做了个「禾月小历」,一套代码跑微信小程序和 H5
前端
IT_陈寒9 小时前
Java实战技巧总结:当你的finally块没有执行时会发生什么?
前端·人工智能·后端
小帅不太帅9 小时前
一年一次黑五,为了买软件真省钱,我做了个开源小站
前端·人工智能·github
JavaGuide11 小时前
刚刚,阿里版 Codex 上线了匿名模型 HungerG,无限 Token!
前端·后端
zhanlang021711 小时前
HTML 零基础入门到企业实战全套教程【第九章 9.3】移动端 HTML 基础适配入门
前端·html
用户693717500138411 小时前
AI 帮我写了大半年的代码,我却越来越不会写代码了
前端·后端·github
skywalk816311 小时前
把「假成功」赶出工具层:lightharness 两天升级复盘(4×5 模式矩阵 + 工具层 5 个缺陷)
开发语言·前端·人工智能·lightharness