前端--基础页面制作

发布于 2022-7-21 15:39
浏览
0收藏

@toc

1.CSS拟态图标的制作

1.1页面布局

1.取图标图片–用ps切片切出图片
2.一个外大盒子+内三行+每行五个盒子(建议用flex布局会好写很多)
3.没什么难点,耐心点就行(注意阴影的理解)
前端--基础页面制作-开源基础软件社区

1.2动画效果–阴影切换(看文件视频)

文件代码如下:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        .box {
            width: 764px;
            height: 591px;
            background-color: #f0efef;
            margin: 30px auto;
            overflow: hidden;
        }

        .box1 {
            width: 100px;
            height: 130px;
            /* border: 1px solid #ccc; */
            margin: 20px 20px 50px;
            /* display: inline; */
            float: left;
        }
        .img1 {
            width: 100px;
            height: 100px;
            /* background-color: goldenrod; */
            border-radius: 20px;
            box-shadow: 10px 10px 20px #ccc, -10px -10px 20px #fff;
        }

        .img1 img {
            width: 60px;
            height: 60px;
            margin: 20px;
            transition: 0.5s;
        }

        .box1 p {
            color: #6c7b8a;
            text-align: center;
            margin: 13px auto;
        }

        .img1:hover {
            box-shadow: 10px 10px 20px #ccc inset, -10px -10px 20px #fff inset, 1px 1px 5px #ccc, -1px -1px 5px #fff;
        }

        .img1:hover img {
            width: 50px;
            height: 50px;
            margin: 25px;
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="box1">
            <div class="img1">
                <img src="images/dh.png" alt="">
            </div>
            <p>电话</p>
        </div>

        <div class="box1">
            <div class="img1">
                <img src="images/dh.png" alt="">
            </div>
            <p>电话</p>
        </div>

        <div class="box1">
            <div class="img1">
                <img src="images/dh.png" alt="">
            </div>
            <p>电话</p>
        </div>

        <div class="box1">
            <div class="img1">
                <img src="images/dh.png" alt="">
            </div>
            <p>电话</p>
        </div>

        <div class="box1">
            <div class="img1">
                <img src="images/dh.png" alt="">
            </div>
            <p>电话</p>
        </div>

        <div class="box1">
            <div class="img1">
                <img src="images/dh.png" alt="">
            </div>
            <p>电话</p>
        </div>

        <div class="box1">
            <div class="img1">
                <img src="images/dh.png" alt="">
            </div>
            <p>电话</p>
        </div>

        <div class="box1">
            <div class="img1">
                <img src="images/dh.png" alt="">
            </div>
            <p>电话</p>
        </div>

        <div class="box1">
            <div class="img1">
                <img src="images/dh.png" alt="">
            </div>
            <p>电话</p>
        </div>

        <div class="box1">
            <div class="img1">
                <img src="images/dh.png" alt="">
            </div>
            <p>电话</p>
        </div>

        <div class="box1">
            <div class="img1">
                <img src="images/dh.png" alt="">
            </div>
            <p>电话</p>
        </div>

        <div class="box1">
            <div class="img1">
                <img src="images/dh.png" alt="">
            </div>
            <p>电话</p>
        </div>

        <div class="box1">
            <div class="img1">
                <img src="images/dh.png" alt="">
            </div>
            <p>电话</p>
        </div>

        <div class="box1">
            <div class="img1">
                <img src="images/dh.png" alt="">
            </div>
            <p>电话</p>
        </div>

        <div class="box1">
            <div class="img1">
                <img src="images/dh.png" alt="">
            </div>
            <p>电话</p>
        </div>

    </div>
</body>

</html>

分类
8-css拟态图标制作.zip 980.05K 5次下载
已于2022-7-21 17:33:27修改
收藏
回复
举报
回复
添加资源
添加资源将有机会获得更多曝光,你也可以直接关联已上传资源 去关联
    相关推荐