CSS3动画制作一个卡通风格的404错误页面代码
更新:2020-04-19 12:00:36
人气:6959
来源:本站原创
A+
CSS3动画制作一个卡通风格的404错误页面代码(有动画效果)
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Css 404错误页</title> <style> .error-container { text-align: center; font-size: 106px; font-family: "Catamaran", sans-serif; font-weight: 800; margin: 70px 15px; } .error-container > span { display: inline-block; position: relative; } .error-container > span.four { width: 136px; height: 43px; border-radius: 999px; background: linear-gradient( 140deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.07) 43%, transparent 44%, transparent 100% ), linear-gradient( 105deg, transparent 0%, transparent 40%, rgba(0, 0, 0, 0.06) 41%, rgba(0, 0, 0, 0.07) 76%, transparent 77%, transparent 100% ), linear-gradient(to right, #d89ca4, #e27b7e); } .error-container > span.four:before, .error-container > span.four:after { content: ""; display: block; position: absolute; border-radius: 999px; } .error-container > span.four:before { width: 43px; height: 156px; left: 60px; bottom: -43px; background: linear-gradient( 128deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.07) 40%, transparent 41%, transparent 100% ), linear-gradient( 116deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.07) 50%, transparent 51%, transparent 100% ), linear-gradient(to top, #99749d, #b895ab, #cc9aa6, #d7969e, #e0787f); } .error-container > span.four:after { width: 137px; height: 43px; transform: rotate(-49.5deg); left: -18px; bottom: 36px; background: linear-gradient( to right, #99749d, #b895ab, #cc9aa6, #d7969e, #e0787f ); } .error-container > span.zero { vertical-align: text-top; width: 156px; height: 156px; border-radius: 999px; background: linear-gradient( -45deg, transparent 0%, rgba(0, 0, 0, 0.06) 50%, transparent 51%, transparent 100% ), linear-gradient( to top right, #99749d, #99749d, #b895ab, #cc9aa6, #d7969e, #ed8687, #ed8687 ); overflow: hidden; animation: bgshadow 5s infinite; } .error-container > span.zero:before { content: ""; display: block; position: absolute; transform: rotate(45deg); width: 90px; height: 90px; background-color: transparent; left: 0px; bottom: 0px; background: linear-gradient( 95deg, transparent 0%, transparent 8%, rgba(0, 0, 0, 0.07) 9%, transparent 50%, transparent 100% ), linear-gradient( 85deg, transparent 0%, transparent 19%, rgba(0, 0, 0, 0.05) 20%, rgba(0, 0, 0, 0.07) 91%, transparent 92%, transparent 100% ); } .error-container > span.zero:after { content: ""; display: block; position: absolute; border-radius: 999px; width: 70px; height: 70px; left: 43px; bottom: 43px; background: #fdfaf5; box-shadow: -2px 2px 2px 0px rgba(0, 0, 0, 0.1); } .screen-reader-text { position: absolute; top: -9999em; left: -9999em; } @keyframes bgshadow { 0% { box-shadow: inset -160px 160px 0px 5px rgba(0, 0, 0, 0.4); } 45% { box-shadow: inset 0px 0px 0px 0px rgba(0, 0, 0, 0.1); } 55% { box-shadow: inset 0px 0px 0px 0px rgba(0, 0, 0, 0.1); } 100% { box-shadow: inset 160px -160px 0px 5px rgba(0, 0, 0, 0.4); } } /* demo stuff */ * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } body { background-color: #fdfaf5; margin-bottom: 50px; } html, button, input, select, textarea { font-family: "Montserrat", Helvetica, sans-serif; color: #bbb; } h1 { text-align: center; margin: 30px 15px; } .zoom-area { max-width: 490px; margin: 30px auto 30px; font-size: 19px; text-align: center; } .link-container { text-align: center; } a.more-link { text-transform: uppercase; font-size: 13px; background-color: #de7e85; padding: 10px 15px; border-radius: 0; color: #fff; display: inline-block; margin-right: 5px; margin-bottom: 5px; line-height: 1.5; text-decoration: none; margin-top: 50px; letter-spacing: 1px; } </style> </head> <body> <h1>404 Error Page</h1> <p class="zoom-area"><b>CSS</b> animations to make a cool 404 page. </p> <section class="error-container"> <span class="four"><span class="screen-reader-text">4</span></span> <span class="zero"><span class="screen-reader-text">0</span></span> <span class="four"><span class="screen-reader-text">4</span></span></section> </body> </html>
推荐的文章
随手记
- ● 统信UOS系统如何设置指定时间自动重启系统的方法
- ● 自制(IP或域名)可信任的SSL证书,适用360、chrome等浏览器
- ● windows系统下php无法使用curl怎么办?
- ● 绿联UGREENKVM切换器(分屏器)快捷键丢失解决办法
- ● 统信UOS开机指定网址全屏启动自带浏览器以及屏蔽ALT+F4关闭
- ● xshellSSH连接Linux服务器防止超时退出
- ● php8开启OpenSSL扩展库报错disabledinstallext
- ● 统信系统linux安装php时的报错libxml-2.0>=2.7.6
- ● tidb关闭sql_mode=ONLY_FULL_GROUP_BY模式
- ● windows10如何开机自动运行bat文件
PHP经验分享
- ● PHP批量对TCP服务端指定多个IP非阻塞检查在线状态
- ● python实现TCP服务端持续接收关机、重启指令并输出结果【系列三】
- ● PHP给TCP服务端发送指令【系列二】
- ● PHP判断TCP服务端是否在线【系列一】
- ● PHP判断远程文件是否存在
- ● LINUX下用PHP获取CPU型号、内存占用、硬盘占用等信息代码
- ● PHP代码用UDP方式远程唤醒电脑让计算机开机
- ● apache下php生成验证码图片不能显示
- ● PHP使用AES加密解密示例(无偏移)
- ● Pluginmysql_native_passwordreported:''mysql_native_password'isdeprecate问题