Css3图片阴影效果_Css3相册阴影效果(一)

一、Css3图片阴影效果_Css3相册阴影效果

html代码:

复制代码
<!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>
        body {
            background-color: #fafafa;
        }

        .img {
            width: 200px;
            height: 200px;
            background: white;
            position: relative;
            left: 100px;
            top: 100px;
       
        }

        .img:hover::before,
        .img:hover::after {
            box-shadow: 0px 15px 10px rgba(0, 0, 0, 0.3);
        }

        .img::before {
            content: '';
            width: 50%;
            height: 20px;
            background: #eee;
            position: absolute;
            z-index: -1;
            bottom: 10px;
            left: 5px;
            transform: skewY(-6deg);
            box-shadow: 0px 15px 10px rgba(0, 0, 0, 0.1);
            transition: all ease 0.8s;
        }

        .img::after {
            content: '';
            width: 50%;
            height: 20px;
            background: #eee;
            position: absolute;
            z-index: -1;
            bottom: 10px;
            right: 5px;
            transform: skewY(6deg);
            box-shadow: 0px 15px 10px rgba(0, 0, 0, 0.1);
            transition: all ease 0.8s;
        }
    </style>
</head>

<body>
    <!-- Css3图片阴影效果 -->
    <div class="img"></div>
</body>

</html>
复制代码

 

二、效果变换过程

 

 

鼠标滑过: 

 

 

 

更多:

Html 鼠标滑过展示内容方案1_使用Css控制

 JS九宫格抽奖代码案例

HTML5实现简单圆周运动示例

posted @   天马3798  阅读(210)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
历史上的今天:
2015-12-18 手机浏览器事件
2015-12-18 手机端html5触屏事件(touch事件)
2015-12-18 js 判断微信浏览器(转)
2015-12-18 html禁止手机页面放大缩小
点击右上角即可分享
微信分享提示