【HTML+CSS】新拟态网页图标-源码

效果图

图片[1]-【HTML+CSS】新拟态网页图标-源码-奥力呦给

由于自建项目、服务较多,时间长了容易忘记,并且为了方便展示,所以在找到一款【HTML+CSS】新拟态网页图标-源码,用于做导航页使用。

代码

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="index.css">
    <title>Document</title>
</head>
<body>
    <!-- 整个大盒子-->
    <div class="container">
        <!--每个图标的小盒子-->
        <div class="box">
            <!-- 放图标的小盒子-->
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="https://blog.aoliyougei.com/wp-content/uploads/2022/12/logoyuan.png" ></a>
            </div>
            <!--图标名称-->
            <p>卫星发射</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="https://blog.aoliyougei.com/wp-content/uploads/2022/12/tx.png" ></a>
                
            </div>
            <p>卫星探测</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/天文台.SVG.png" ></a>
            </div>
            <p>天文台</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/彗星.SVG.png" ></a>
            </div>
            <p>彗星</p>
        </div>
        <div class="box">
            <div class="img">
                <img src="./image/探测器.SVG.png" >
            </div>
            <p>探测器</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/月球公转.SVG.png" ></a>
            </div>
            <p>月球公转</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/月球自传.SVG.png" ></a>
            </div>
            <p>月球自传</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/木星.SVG.png" ></a>
            </div>
            <p>木星</p>
        </div>
        <div class="box">
            <div class="img">
                <img src="./image/流星.SVG.png" >
            </div>
            <p>流星</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/火箭发射.SVG.png" ></a>
            </div>
            <p>火箭发射</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/登月.SVG.png" ></a>
            </div>
            <p>登月</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/登月车.SVG.png" ></a>
            </div>
            <p>登月车</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/空间站.SVG.png" ></a>
            </div>
            <p>空间站</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/陨石.SVG.png" ></a>
            </div>
            <p>陨石</p>
        </div>
    </div>
</body>
</html>
*{
    margin: 0;
    padding: 0;
}
body{
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    background-color: #efeeee;
}

.containertb{
    width: 700px;
    height: 600px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    align-items: center;
}
.container .box{
    display: flex;
    justify-content: space-around;
    flex-direction: column;
    align-items: center;
    align-content: center;
    width: 100px;
    height: 140px;
    margin: 20px;
}
.container .box .img{
    width: 100px;
    height: 100px;
    box-shadow: 18px 18px 30px rgba(0, 0, 0, 0.1),
    -18px -18px 30px rgba(255, 255, 255, 1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #efeeee;
    transition: box-shadow .2s ease-in-out;
}
.container .box .img img{
    width: 100px;
    transition: width .2s ease-out;
    pointer-events: none;
}
.container .box p{
    color: slategray;
}

.container .box .img:hover{
    box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.1),
    0px 0px 0px rgba(255, 255, 255, 1),
    inset 18px 18px 30px rgba(0, 0, 0, 0.1),
    inset -18px -18px 30px rgba(255, 255, 255, 1);
    transition: box-shadow .2s ease-out;
}

.container .box .img:hover img{
    width: 58px;
    transition: width .2s ease-out;
}

子比主题

网站管理后台—>页面—>新建页面—>自定义HTML,把下面的 html 代码复制粘贴到里面即可。

    <!-- 整个大盒子-->
    <div class="logo">
        <!--每个图标的小盒子-->
        <div class="box">
            <!-- 放图标的小盒子-->
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="https://blog.aoliyougei.com/wp-content/uploads/2022/12/logoyuan.png" ></a>
            </div>
            <!--图标名称-->
            <p>卫星发射</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="https://blog.aoliyougei.com/wp-content/uploads/2022/12/tx.png" ></a>
                
            </div>
            <p>卫星探测</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/天文台.SVG.png" ></a>
            </div>
            <p>天文台</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/彗星.SVG.png" ></a>
            </div>
            <p>彗星</p>
        </div>
        <div class="box">
            <div class="img">
                <img src="./image/探测器.SVG.png" >
            </div>
            <p>探测器</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/月球公转.SVG.png" ></a>
            </div>
            <p>月球公转</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/月球自传.SVG.png" ></a>
            </div>
            <p>月球自传</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/木星.SVG.png" ></a>
            </div>
            <p>木星</p>
        </div>
        <div class="box">
            <div class="img">
                <img src="./image/流星.SVG.png" >
            </div>
            <p>流星</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/火箭发射.SVG.png" ></a>
            </div>
            <p>火箭发射</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/登月.SVG.png" ></a>
            </div>
            <p>登月</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/登月车.SVG.png" ></a>
            </div>
            <p>登月车</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/空间站.SVG.png" ></a>
            </div>
            <p>空间站</p>
        </div>
        <div class="box">
            <div class="img">
                <a href = "https://blog.aoliyougei.com">
                <img src="./image/陨石.SVG.png" ></a>
            </div>
            <p>陨石</p>
        </div>
    </div>

网站管理后台—>主题设置—>全局&功能—>自定义代码—>自定义 CSS 代码,把下面的 CSS 代码复制粘贴到里面即可。

/*【HTML+CSS】新拟态网页图标-logo~页面开始*/
/* by: aoliyougei.com */
.logo{
    display: flex; 
    justify-content: space-around;
    flex-wrap: wrap;
    align-items: center;
}
.logo .box{
    display: flex;
    justify-content: space-around;
    flex-direction: column;
    align-items: center;
    align-content: center;
    width: 100px;
    height: 140px;
    margin: 20px;
}
.logo .box .img{
    width: 100px;
    height: 100px;
    box-shadow: 18px 18px 30px rgba(0, 0, 0, 0.1),
    -18px -18px 30px rgba(255, 255, 255, 1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #efeeee;
    transition: box-shadow .2s ease-in-out;
}
.logo .box .img img{
    width: 100px;
    transition: width .2s ease-out;
    pointer-events: none;

}
.logo .box p{
    color: slategray;
}

.logo .box .img:hover{
    box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.1),
    0px 0px 0px rgba(255, 255, 255, 1),
    inset 18px 18px 30px rgba(0, 0, 0, 0.1),
    inset -18px -18px 30px rgba(255, 255, 255, 1);
    transition: box-shadow .2s ease-out;
}

.logo .box .img:hover img{
    width: 58px;
    transition: width .2s ease-out;
}
/*【HTML+CSS】新拟态网页图标-logo~页面结束*/
------本页内容已结束,喜欢请分享------

感谢您的来访,获取更多精彩文章请收藏本站。

© 版权声明
THE END
喜欢就支持一下吧
点赞9 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容