CSS-实现404旋转

CSS-实现404旋转

只用css实现404外面的边框旋转

html代码

<div class="warning">ERROR 404</div>

css代码

body {
  margin: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgb(20%, 20%, 20%);
}

.warning {
	color: whitesmoke;
	font-size: 80px;
	font-family: sans-serif;
	font-weight: bold;
	position: relative;
	padding: 0.6em 0.4em;
}

.warning::before,
.warning::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border-width: 0.2em;
	box-sizing: border-box;
	color: orangered;
	animation: rotating 10s infinite;
}

.warning::before {
	border-style: solid solid none none;
	z-index: -1;
}

.warning::after {
	border-style: none none solid solid;
	box-shadow: 0.3em 0.3em 0.3em rgba(20%, 20%, 20%, 0.8);
}

@keyframes rotating {
	to {
		transform: rotate(360deg);
	}
}
© 版权声明
THE END
喜欢就支持一下吧
点赞9赞赏 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情图片

    暂无评论内容