简单的 404 界面

综合1 7,630,949字数 896阅读2分59秒

编写简单的 404 界面,也可以用来做 500 报错界面,还会飘东西,特别好,蛮漂亮的!

复制代码
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title>404</title>
  6. <style>
  7. html, body {
  8. height: 100%;
  9. min-height: 450px;
  10. font-size: 32px;
  11. font-weight: 500;
  12. color: #5d7399;
  13. margin: 0;
  14. padding: 0;
  15. border: 0;
  16. }
  17. .content {
  18. height: 100%;
  19. position: relative;
  20. z-index: 1;
  21. background-color: #d2e1ec;
  22. background-image: -webkit-linear-gradient(top, #bbcfe1 0%, #e8f2f6 80%);
  23. background-image: linear-gradient(to bottom, #bbcfe1 0%, #e8f2f6 80%);
  24. overflow: hidden;
  25. }
  26. .snow {
  27. position: absolute;
  28. top: 0;
  29. left: 0;
  30. pointer-events: none;
  31. z-index: 20;
  32. }
  33. .main-text {
  34. padding: 20vh 20px 0 20px;
  35. text-align: center;
  36. line-height: 2em;
  37. font-size: 5vh;
  38. }
  39. .main-text h1 {
  40. font-size: 45px;
  41. line-height: 48px;
  42. margin: 0;
  43. padding: 0;
  44. }
  45. .main-text-a {
  46. height: 32px;
  47. margin-left: auto;
  48. margin-right: auto;
  49. text-align: center;
  50. }
  51. .main-text-a a {
  52. font-size: 16px;
  53. text-decoration: none;
  54. color: #0066CC;
  55. }
  56. .main-text-a a:hover {
  57. color: #000;
  58. }
  59. .home-link {
  60. font-size: 0.6em;
  61. font-weight: 400;
  62. color: inherit;
  63. text-decoration: none;
  64. opacity: 0.6;
  65. border-bottom: 1px dashed rgba(93, 115, 153, 0.5);
  66. }
  67. .home-link:hover {
  68. opacity: 1;
  69. }
  70. .ground {
  71. height: 160px;
  72. width: 100%;
  73. position: absolute;
  74. bottom: 0;
  75. left: 0;
  76. background: #f6f9fa;
  77. box-shadow: 0 0 10px 10px #f6f9fa;
  78. }
  79. .ground:before, .ground:after {
  80. content: '';
  81. display: block;
  82. width: 250px;
  83. height: 250px;
  84. position: absolute;
  85. top: -62.5px;
  86. z-index: -1;
  87. background: transparent;
  88. -webkit-transform: scaleX(0.2) rotate(45deg);
  89. transform: scaleX(0.2) rotate(45deg);
  90. }
  91. .ground:after {
  92. left: 50%;
  93. margin-left: -166.66667px;
  94. box-shadow: -340px 260px 15px #8193b2, -620px 580px 15px #8193b2, -900px 900px 15px #b0bccf, -1155px 1245px 15px #b4bed1, -1515px 1485px 15px #8193b2, -1755px 1845px 15px #8a9bb8, -2050px 2150px 15px #91a1bc, -2425px 2375px 15px #bac4d5, -2695px 2705px 15px #a1aec6, -3020px 2980px 15px #8193b2, -3315px 3285px 15px #94a3be, -3555px 3645px 15px #9aa9c2, -3910px 3890px 15px #b0bccf, -4180px 4220px 15px #bac4d5, -4535px 4465px 15px #a7b4c9, -4840px 4760px 15px #94a3be;
  95. }
  96. .ground:before {
  97. right: 50%;
  98. margin-right: -166.66667px;
  99. box-shadow: 325px -275px 15px #b4bed1, 620px -580px 15px #adb9cd, 925px -875px 15px #a1aec6, 1220px -1180px 15px #b7c1d3, 1545px -1455px 15px #7e90b0, 1795px -1805px 15px #b0bccf, 2080px -2120px 15px #b7c1d3, 2395px -2405px 15px #8e9eba, 2730px -2670px 15px #b7c1d3, 2995px -3005px 15px #9dabc4, 3285px -3315px 15px #a1aec6, 3620px -3580px 15px #8193b2, 3880px -3920px 15px #aab6cb, 4225px -4175px 15px #9dabc4, 4510px -4490px 15px #8e9eba, 4785px -4815px 15px #a7b4c9;
  100. }
  101. .mound {
  102. margin-top: -80px;
  103. font-weight: 800;
  104. font-size: 180px;
  105. text-align: center;
  106. color: #dd4040;
  107. pointer-events: none;
  108. }
  109. .mound:before {
  110. content: '';
  111. display: block;
  112. width: 600px;
  113. height: 200px;
  114. position: absolute;
  115. left: 50%;
  116. margin-left: -300px;
  117. top: 50px;
  118. z-index: 1;
  119. border-radius: 100%;
  120. background-color: #e8f2f6;
  121. background-image: -webkit-linear-gradient(top, #dee8f1, #f6f9fa 60px);
  122. background-image: linear-gradient(to bottom, #dee8f1, #f6f9fa 60px);
  123. }
  124. .mound:after {
  125. content: '';
  126. display: block;
  127. width: 28px;
  128. height: 6px;
  129. position: absolute;
  130. left: 50%;
  131. margin-left: -150px;
  132. top: 68px;
  133. z-index: 2;
  134. background: #dd4040;
  135. border-radius: 100%;
  136. -webkit-transform: rotate(-15deg);
  137. transform: rotate(-15deg);
  138. box-shadow: -56px 12px 0 1px #dd4040, -126px 6px 0 2px #dd4040, -196px 24px 0 3px #dd4040;
  139. }
  140. .mound_text {
  141. -webkit-transform: rotate(6deg);
  142. transform: rotate(6deg);
  143. }
  144. .mound_spade {
  145. display: block;
  146. width: 35px;
  147. height: 30px;
  148. position: absolute;
  149. right: 50%;
  150. top: 42%;
  151. margin-right: -250px;
  152. z-index: 0;
  153. -webkit-transform: rotate(35deg);
  154. transform: rotate(35deg);
  155. background: #dd4040;
  156. }
  157. .mound_spade:before, .mound_spade:after {
  158. content: '';
  159. display: block;
  160. position: absolute;
  161. }
  162. .mound_spade:before {
  163. width: 40%;
  164. height: 30px;
  165. bottom: 98%;
  166. left: 50%;
  167. margin-left: -20%;
  168. background: #dd4040;
  169. }
  170. .mound_spade:after {
  171. width: 100%;
  172. height: 30px;
  173. top: -55px;
  174. left: 0%;
  175. box-sizing: border-box;
  176. border: 10px solid #dd4040;
  177. border-radius: 4px 4px 20px 20px;
  178. }
  179. </style>
  180. </head>
  181. <body translate="no">
  182. <div class="content">
  183. <canvas class="snow" id="snow" width="1349" height="400"></canvas>
  184. <div class="main-text">
  185. <h1>404 天呐!出错了 ~<br><br>您好像去了一个不存在的地方! (灬ꈍ ꈍ灬)</h1>
  186. <div class="main-text-a"><a href="#">< 返回 首页</a></div>
  187. </div>
  188. <div class="ground">
  189. <div class="mound">
  190. <div class="mound_text">404</div>
  191. <div class="mound_spade"></div>
  192. </div>
  193. </div>
  194. </div>
  195. <script>
  196. (function () {
  197. function ready(fn) {
  198. if (document.readyState != 'loading') {
  199. fn();
  200. } else {
  201. document.addEventListener('DOMContentLoaded', fn);
  202. }
  203. }
  204. function makeSnow(el) {
  205. var ctx = el.getContext('2d');
  206. var width = 0;
  207. var height = 0;
  208. var particles = [];
  209. var Particle = function () {
  210. this.x = this.y = this.dx = this.dy = 0;
  211. this.reset();
  212. }
  213. Particle.prototype.reset = function () {
  214. this.y = Math.random() * height;
  215. this.x = Math.random() * width;
  216. this.dx = (Math.random() * 1) - 0.5;
  217. this.dy = (Math.random() * 0.5) + 0.5;
  218. }
  219. function createParticles(count) {
  220. if (count != particles.length) {
  221. particles = [];
  222. for (var i = 0; i < count; i++) {
  223. particles.push(new Particle());
  224. }
  225. }
  226. }
  227. function onResize() {
  228. width = window.innerWidth;
  229. height = window.innerHeight;
  230. el.width = width;
  231. el.height = height;
  232. createParticles((width * height) / 10000);
  233. }
  234. function updateParticles() {
  235. ctx.clearRect(0, 0, width, height);
  236. ctx.fillStyle = '#f6f9fa';
  237. particles.forEach(function (particle) {
  238. particle.y += particle.dy;
  239. particle.x += particle.dx;
  240. if (particle.y > height) {
  241. particle.y = 0;
  242. }
  243. if (particle.x > width) {
  244. particle.reset();
  245. particle.y = 0;
  246. }
  247. ctx.beginPath();
  248. ctx.arc(particle.x, particle.y, 5, 0, Math.PI * 2, false);
  249. ctx.fill();
  250. });
  251. window.requestAnimationFrame(updateParticles);
  252. }
  253. onResize();
  254. updateParticles();
  255. }
  256. ready(function () {
  257. var canvas = document.getElementById('snow');
  258. makeSnow(canvas);
  259. });
  260. })();
  261. </script>
  262. </body>
  263. </html>

 文章源自小武站https://1z345.cn/小武站-https://bbs.50-0.cn/772.html 文章源自小武站https://1z345.cn/小武站-https://bbs.50-0.cn/772.html

继续阅读
分享一个好看的404html页面
分享一个好看的404html页面 综合

分享一个好看的404html页面

网站新建的时候都会有默认的404页面,但是感觉那个不好看于是就自己找了个并且修改了一下代码<!DOCTYPE html> <html> <head> <met...
移动5元开通12个月爱优腾会员
移动5元开通12个月爱优腾会员 综合

移动5元开通12个月爱优腾会员

15元Plus会员娱乐版(12个月合约期 爱优腾等会员任选12个月 1款plus会员(随心选娱乐版2021)120元话费券112张10元话费券,限本机使用1;每月解锁1张10元话费券1单笔充值50元及...
  • 本文由 admin 发表于2024年8月14日 16:41:59
  • 转载请务必保留本文链接:https://bbs.50-0.cn/772.html
    • 匿名
      匿名 4

      好看好看

    匿名

    发表评论

    匿名网友
    确定