css3+svg制作404页面动画效果HTML源码

源码介绍

css3 svg制作404页面动画效果HTML源码,适合做网站错误页或者网站404丢失页,界面简约美观,带有返回主页按钮,源码简单单页源码,创建一个index.html将代码拷贝进去即可

效果截图

图片[1]-css3+svg制作404页面动画效果HTML源码-QQ沐编程

源代码

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>svg 404页面</title>

<style>
body, html{
  margin: 0 auto;
  padding: 0;
  font-weight: 800;
}

body{
  background: #000;
  font-family: cursive;
}

svg {
    display: block;
    font: 10.5em 'Monoton';
    width: 960px;
    height: 300px;
    margin: 0 auto;
}

.content{
  text-align: center;
}

h1{
  text-align: center;
  font: 2em 'Roboto', sans-serif;
  font-weight: 900;
  color: #2f8f7f;
  opacity: .6;
}

a{
   display: inline-block;
   text-transform: uppercase;
   font: 1em 'Roboto';
   font-weight: 300;
   border: 1px solid #2f8f7f;
   border-radius: 4px;
   color: #2f8f7f;
   margin-top: 10%;
   padding: 8px 14px;
   text-decoration: none;
   opacity: .6;
}

.text {
    fill: none;
    stroke: white;
    stroke-dasharray: 8% 29%;
    stroke-width: 5px;
    stroke-dashoffset: 1%;
    animation: stroke-offset 5.5s infinite linear;
}

.text:nth-child(1){
	stroke: #1c234d;
	animation-delay: -1;
}

.text:nth-child(2){
	stroke: #315b2c;
	animation-delay: -2s;
}

.text:nth-child(3){
	stroke: #2f8f7f;
	animation-delay: -3s;
}

.text:nth-child(4){
	stroke: #2f8f7f;
	animation-delay: -4s;
}

.text:nth-child(5){
	stroke: #da2717;
	animation-delay: -5s;
}

@keyframes stroke-offset{
	100% {
    stroke-dashoffset: -35%;
  }
}
</style>
</head>
<body>

<link href="https://fonts.googleapis.com/css?family=Monoton" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">

<svg viewBox="0 0 960 300">
	<symbol id="s-text">
		<text text-anchor="middle" x="50%" y="80%">404</text>
	</symbol>

	<g class = "g-ants">
		<use xlink:href="#s-text" class="text"></use>
		<use xlink:href="#s-text" class="text"></use>
		<use xlink:href="#s-text" class="text"></use>
		<use xlink:href="#s-text" class="text"></use>
		<use xlink:href="#s-text" class="text"></use>
	</g>
</svg>
<div class="content">
    <h1>页面未找到</h1>
    <a href="https://www.qqmu.com">返回首页</a>
</div>

</body>
</html>

 

© 版权声明
THE END
喜欢就支持一下吧
点赞11赞赏 分享