日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > CSS >内容正文

CSS

纯CSS边框渐变动画

發布時間:2023/12/15 CSS 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 纯CSS边框渐变动画 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一:CSS與圖片參考

<style>

html,body,.box {

height:100%;

display:flex;

align-items:center;

justify-content:center;

}

body {

background-color:#222;

}

.box{

font-size:2.5em;

width:10em;

height:5em;

background-color:#111;

border-radius:0.5em;

text-align:center;

line-height:1.5em;

font-family:sans-serif;

animation:animate_text 2s linear infinite alternate;

position:relative;

}

.box::before {

content:'';

position:absolute;

width:calc(100% + 10%);

height:calc(100% + 20%);

border-radius:0.5em;

z-index:-1;

background-image:linear-gradient(60deg,aquamarine,cornflowerblue,goldenrod,hotpink,salmon,lightgreen,sandybrown,violet);

background-size:300%;

animation:animate_bg 5s infinite;

}

@keyframes animate_bg {

0%,100% {

background-position:0%,50%;

}

50% {

background-position:100%,50%;

}

}

@keyframes animate_text {

from {

color:lime;

}

to {

color:yellow;

}

}

</style>

?

二:HTML

<body>

<div class="box">

you are my<br> FAVORITE

</div>

</body>

總結

以上是生活随笔為你收集整理的纯CSS边框渐变动画的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。