「兔了个兔」福兔贺春,分享一款精美404兔兔网页!(附源码)

256 阅读2分钟

我正在参加「兔了个兔」创意投稿大赛,详情请看:「兔了个兔」创意投稿大赛


前言

各位小伙伴们大家好呀,今天给大家分享一款精美404兔兔网页,让我们一起来看看吧!


效果演示

image.png


实现思路

  看完效果图后,各位小伙伴们肯定很想知道实现的思路,接下来我将分步骤逐一进行讲解。

我将实现思路分成了如下三个部分,列举如下:

  • 背景设计
  • 404元素设计
  • 睡觉兔兔设计

在本案例中,睡觉兔兔是使用gif图进行引入的,我们还可以换成其他的小兔兔。

 背景设计

image.png

  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>网页丢失了哦!</title>
</head>
<style> 
</style>
<body>
</body>
</html>

  CSS代码

  将下面代码复制粘贴至<style></style>标签之间

body {
  background-color: #f8fcf8;
}

 404元素设计 | 兔兔gif引入

image.png

  HTML代码

  将下面代码复制粘贴至<body></body>标签之间

<div class="frem">
        <p>404</p>
        <h2>看起来你迷路了</h2>
        <h5>你所寻找的页面已丢失!</h5>
        <a href="http://wyz-math.cn">返回首页</a>
    </div>

  CSS代码

  将下面代码复制粘贴至<style></style>标签之间

* {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    .frem{
        width: 100%;
        height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        border-radius: 3.3rem;
        background: url('https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/425a4496b53148c8a272d3f8122d341e~tplv-k3u1fbpfcp-watermark.image?');
        background-position: center;
        background-repeat: no-repeat;
    }
    .frem p{
        position: absolute;
        top: 3rem;
        font-size: 7rem;
        color: #00000063;
    }
    .frem h2{
        position: absolute;
        bottom: 8rem;
        font-size: 34px;
    }
    .frem h5{
        position: absolute;
        bottom: 6rem;
        color: #9c9c9c;
    }
    .frem a{
        position: absolute;
        bottom: 1rem;
        background: linear-gradient(45deg, #2a98ff, #09ff00);
        padding: 12px;
        color: white;
        text-decoration: none;
        font-size: 20px;
        border-radius: 13px;
    }

完整源码

<!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>网页丢失了哦!</title>
</head>
<style>
	body {
  background-color: #f8fcf8;
    }
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    .frem{
        width: 100%;
        height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        border-radius: 3.3rem;
        background: url('https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/425a4496b53148c8a272d3f8122d341e~tplv-k3u1fbpfcp-watermark.image?');
        background-position: center;
        background-repeat: no-repeat;
    }
    .frem p{
        position: absolute;
        top: 3rem;
        font-size: 7rem;
        color: #00000063;
    }
    .frem h2{
        position: absolute;
        bottom: 8rem;
        font-size: 34px;
    }
    .frem h5{
        position: absolute;
        bottom: 6rem;
        color: #9c9c9c;
    }
    .frem a{
        position: absolute;
        bottom: 1rem;
        background: linear-gradient(45deg, #2a98ff, #09ff00);
        padding: 12px;
        color: white;
        text-decoration: none;
        font-size: 20px;
        border-radius: 13px;
    }

</style>

<body>
    <div class="frem">
        <p>404</p>
        <h2>看起来你迷路了</h2>
        <h5>你所寻找的页面已丢失!</h5>
        <a href="http://wyz-math.cn">返回首页</a>
    </div>
</body>

</html>


码上掘金


写在最后的话

  本文花费大量时间介绍了一款精美404兔兔网页!希望能帮助到各位小伙伴,码文不易,还望各位大佬们多多支持哦,你们的支持是我最大的动力!

在这里插入图片描述

原创不易,还希望各位大佬支持一下\textcolor{blue}{原创不易,还希望各位大佬支持一下}
👍 点赞,你的认可是我创作的动力!\textcolor{9c81c1}{点赞,你的认可是我创作的动力!}
⭐️ 收藏,你的青睐是我努力的方向!\textcolor{ed7976}{收藏,你的青睐是我努力的方向!}
✏️ 评论,你的意见是我进步的财富!\textcolor{98c091}{评论,你的意见是我进步的财富!}