单个div+css实现容器内边框阴影柔光走光动画效果代码

代码语言:html

所属分类:动画

代码描述:单个div+css实现容器内边框阴影柔光走光动画效果代码

代码标签: 单个 div css 容器 边框 阴影 柔光 走光 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  

  
  
  
<style>
@property --a {
  /* must register --a to animate it */
  syntax: "<angle>";
  initial-value: 0deg;
  /* used only on pseudo, nowhere to be inherited, 
   * better perf if set false */
  inherits: false;
}
.card {
  /* hide outer part of glow */
  overflow: hidden;
  /* needed for absolutely positioned pseudo */
  position: relative;
  /* adjust width as needed IF it's even necessary to set */
  width: min(12.5em, 80vmin);
  /* adjust aspect-ratio OR height IF height not given by content */
  aspect-ratio: 1;
  /* round outer card corners */
  border-radius: 0.5em;
  /* text & layout styles below just for prettifying */
  place-self: center;
  place-content: center;
  padding: 0.5em;
  color: #ededed;
  font: clamp(1em, 2vw + 2vh, 2em) sans-serif;
  text-align: center;
  text-transform: uppercase;
  text-wrap: balance;
}

.card::before {
  /* grid doesn't work for stacking when a stacked item is text node */
  position: absolute;
  /* p.........完整代码请登录后点击上方下载按钮下载查看

网友评论0