css3边框渐变效果,字体描边渐变特效
css3边框渐变效果,字体描边渐变特效
html:
<h1 class="title">Stroke</h1>
css:
<style> :root{ --color-background: #000119; --stroke-width: calc(1em / 16); --font-size: 30vmin; --font-weight: 700; --letter-spacing: calc(1em / 8); } *{ -webkit-box-sizing: border-box; box-sizing: border-box; } body{ background-color: #000119; background-color: var(--color-background); display: grid; font-family: Poppins, sans-serif; margin: 0; min-height: 100vh; -webkit-box-align: center; -ms-flex-align: center; align-items: center; justify-items: center; place-items: center; padding: 5vmin; } h1{ -webkit-background-clip: text; background-clip: text; background-image: -webkit-gradient(linear, left top, right top, from(#09f1b8), color-stop(#00a2ff), color-stop(#ff00d2), to(#fed90f)); background-image: -o-linear-gradient(left, #09f1b8, #00a2ff, #ff00d2, #fed90f); background-image: linear-gradient(to right, #09f1b8, #00a2ff, #ff00d2, #fed90f); color: #000119; color: var(--color-background); font-size: 30vmin; font-size: var(--font-size); font-weight: 700; font-weight: var(--font-weight); letter-spacing: calc(1em / 8); letter-spacing: var(--letter-spacing); padding: calc(--stroke-width / 2); -webkit-text-stroke-color: transparent; -webkit-text-stroke-width: calc(1em / 16); -webkit-text-stroke-width: var(--stroke-width); } </style>
还没有留言,还不快点抢沙发?