css实现响应式文字填充渐变动画效果代码
代码语言:html
所属分类:响应式
代码描述:css实现响应式文字填充渐变动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> * { box-sizing: border-box; } @property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; } :root { --clr-bg: black; } body { font-family: "Monda", sans-serif; height: 100svh; margin: 0; padding: 2rem; background-color: var(--clr-bg); background-image: radial-gradient(black, rgb(15, 23, 42)); background-attachment: fixed; display: flex; align-items: center; justify-content: center; flex-direction: column; color: rgb(234, 233, 233); } .wrapper { position: relative; width: min(100%, 600px); } .wrapper > h1 { font-size: clamp(0.8rem, 3.5vw - 0.05rem, 1.2rem); text-align: left; /*text-transform: uppercase;*/ margin: 0; font-weight: 400; } .wrapper > p { position: absolute; top: 100%; right: 0; z-index: -1; transition: opacity 300ms ease-in-out, translate 300ms ease-in-out; translate: 0 -2rem; opacity: 0; font-size: clamp(0.75rem, 2.5vw - 0.05rem, .9rem); text-align: right; margin: 0.5rem 0 0; line-height: 1; } .wrapper:hover > p { opacity: 1; translate: 0; } .celebrate { --line-thickness: clamp(1px, 1.5vw + 1px, 7px); --line-color: var(--clr-bg); --line-radius: var(--line-thickness); --line-offset: calc(var(--line-thickness) * -1); --line-radius: 5px; display: grid; gap: var(--line-thickness); grid-auto-flow: column; grid-template-columns: repeat(4, 1f.........完整代码请登录后点击上方下载按钮下载查看
网友评论0