純CSS繪制Boss直聘的Loading捉捅,最少需要幾個標(biāo)簽撤防?

效果圖

首先,如果我說答案是 1 個HTML標(biāo)簽即可,并且并不用:befroe和:after棒口。你信嗎寄月?

不管你信不信辜膝,代碼就在這里:

//css

.din4 {

display ? ?: inline-block;

color ? ? ?: #fff;

width ? ? ?: 20px;

height ? ? : 20px;

position ? : relative;

background : radial-gradient(circle at 22% 22%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 78% 22%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 22% 78%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 78% 78%, rgba(51, 181, 229, 0.8) 20%, transparent 0%) no-repeat;

animation ?: load4din 1s linear infinite;

margin ? ? : 30px

animation : load4din2 1s linear infinite;

}

@keyframes load4din {

0% {

background : radial-gradient(circle at 22% 22%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 78% 22%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 22% 78%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 78% 78%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

transform ?: rotate(0deg);

}

5% {

background : radial-gradient(circle at 25% 25%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 75% 25%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 25% 75%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 75% 75%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

}

10% {

background : radial-gradient(circle at 28% 28%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 72% 28%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 28% 72%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 72% 72%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

}

15% {

background : radial-gradient(circle at 31% 31%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 69% 31%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 31% 69%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 69% 69%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

}

20% {

background : radial-gradient(circle at 34% 34%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 66% 34%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 34% 66%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 66% 66%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

}

25% {

background : radial-gradient(circle at 37% 37%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 63% 37%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 37% 63%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 63% 63%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

}

30% {

background : radial-gradient(circle at 39% 39%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 61% 39%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 39% 61%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 61% 61%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

}

35% {

background : radial-gradient(circle at 42% 42%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 58% 42%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 42% 58%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 58% 58%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

}

40% {

background : radial-gradient(circle at 45% 45%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 55% 45%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 45% 55%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 55% 55%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

}

45% {

background : radial-gradient(circle at 47% 47%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 53% 47%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 47% 53%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 53% 53%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

}

50% {

background : radial-gradient(circle at 50% 50%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 50% 50%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 50% 50%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 50% 50%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

}

55% {

background : radial-gradient(circle at 47% 47%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 53% 47%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 47% 53%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 53% 53%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

}

60% {

background : radial-gradient(circle at 45% 45%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 55% 45%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 45% 55%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 55% 55%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

}

65% {

background : radial-gradient(circle at 42% 42%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 58% 42%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 42% 58%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 58% 58%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

}

70% {

background : radial-gradient(circle at 39% 39%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 61% 39%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 39% 61%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 61% 61%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

}

75% {

background : radial-gradient(circle at 37% 37%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 63% 37%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 37% 63%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 63% 63%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

}

80% {

background : radial-gradient(circle at 34% 34%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 66% 34%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 34% 66%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 66% 66%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

}

85% {

background : radial-gradient(circle at 31% 31%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 69% 31%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 31% 69%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 69% 69%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

}

90% {

background : radial-gradient(circle at 28% 28%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 72% 28%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 28% 72%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 72% 72%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

}

95% {

background : radial-gradient(circle at 25% 25%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 75% 25%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 25% 75%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 75% 75%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

}

100% {

background : radial-gradient(circle at 22% 22%, rgba(255, 68, 68, 0.8) 20%, transparent 0%),

radial-gradient(circle at 78% 22%, rgba(255, 187, 50, 0.85) 20%, transparent 0%),

radial-gradient(circle at 22% 78%, rgba(153, 204, 0, 0.8) 20%, transparent 0%),

radial-gradient(circle at 78% 78%, rgba(51, 181, 229, 0.8) 20%, transparent 0%);

transform ?: rotate(360deg);

}

}



//html

<b class="din4"></b>

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市漾肮,隨后出現(xiàn)的幾起案子厂抖,更是在濱河造成了極大的恐慌,老刑警劉巖初橘,帶你破解...
    沈念sama閱讀 211,743評論 6 492
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件渠缕,死亡現(xiàn)場離奇詭異薄疚,居然都是意外死亡敦姻,警方通過查閱死者的電腦和手機(jī)宛徊,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,296評論 3 385
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來夜只,“玉大人垒在,你說我怎么就攤上這事∪雍ィ” “怎么了场躯?”我有些...
    開封第一講書人閱讀 157,285評論 0 348
  • 文/不壞的土叔 我叫張陵,是天一觀的道長旅挤。 經(jīng)常有香客問我踢关,道長,這世上最難降的妖魔是什么粘茄? 我笑而不...
    開封第一講書人閱讀 56,485評論 1 283
  • 正文 為了忘掉前任签舞,我火速辦了婚禮,結(jié)果婚禮上柒瓣,老公的妹妹穿的比我還像新娘儒搭。我一直安慰自己,他們只是感情好芙贫,可當(dāng)我...
    茶點故事閱讀 65,581評論 6 386
  • 文/花漫 我一把揭開白布搂鲫。 她就那樣靜靜地躺著,像睡著了一般磺平。 火紅的嫁衣襯著肌膚如雪魂仍。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 49,821評論 1 290
  • 那天拣挪,我揣著相機(jī)與錄音蓄诽,去河邊找鬼。 笑死媒吗,一個胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的乙埃。 我是一名探鬼主播闸英,決...
    沈念sama閱讀 38,960評論 3 408
  • 文/蒼蘭香墨 我猛地睜開眼锯岖,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了甫何?” 一聲冷哼從身側(cè)響起出吹,我...
    開封第一講書人閱讀 37,719評論 0 266
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎辙喂,沒想到半個月后捶牢,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 44,186評論 1 303
  • 正文 獨居荒郊野嶺守林人離奇死亡巍耗,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 36,516評論 2 327
  • 正文 我和宋清朗相戀三年秋麸,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片炬太。...
    茶點故事閱讀 38,650評論 1 340
  • 序言:一個原本活蹦亂跳的男人離奇死亡灸蟆,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出亲族,到底是詐尸還是另有隱情炒考,我是刑警寧澤,帶...
    沈念sama閱讀 34,329評論 4 330
  • 正文 年R本政府宣布霎迫,位于F島的核電站斋枢,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏知给。R本人自食惡果不足惜瓤帚,卻給世界環(huán)境...
    茶點故事閱讀 39,936評論 3 313
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望炼鞠。 院中可真熱鬧缘滥,春花似錦、人聲如沸谒主。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,757評論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽霎肯。三九已至擎颖,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間观游,已是汗流浹背搂捧。 一陣腳步聲響...
    開封第一講書人閱讀 31,991評論 1 266
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點兒被人妖公主榨干…… 1. 我叫王不留懂缕,地道東北人允跑。 一個月前我還...
    沈念sama閱讀 46,370評論 2 360
  • 正文 我出身青樓,卻偏偏與公主長得像,于是被迫代替她去往敵國和親聋丝。 傳聞我的和親對象是個殘疾皇子索烹,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 43,527評論 2 349

推薦閱讀更多精彩內(nèi)容

  • 1、垂直對齊 如果你用CSS弱睦,則你會有困惑:我該怎么垂直對齊容器中的元素百姓?現(xiàn)在,利用CSS3的Transform况木,...
    kiddings閱讀 3,153評論 0 11
  • 【重述知識】 影響精力的因素主要分為體力垒拢、情緒、思想和精神火惊。這四個方面呈金字塔狀態(tài)求类,底層影響上層,也可以決定上層矗晃。...
    鈞陽閱讀 328評論 0 0
  • 起床:4:30 活動:1仑嗅、運動50分:慢跑3.33公里+拉伸;2张症、悅聽《李中瑩第50屆NLP》 (兩性溝通)平等仓技、...
    云水禪心R閱讀 265評論 2 1
  • 今天什么也不想寫,就談?wù)勎易约吼B(yǎng)植物的一些經(jīng)歷吧俗他。 自己養(yǎng)植物已有多年脖捻,一路從小白成長到精通養(yǎng)花人。除了網(wǎng)上搜索養(yǎng)...
    廣陵十四閱讀 262評論 2 1
  • 小主人報8月18日訊(實習(xí)記者 何玉婷)8月18日畏铆,風(fēng)之聲語言培訓(xùn)中心校長——封沛和洋浦經(jīng)濟(jì)開發(fā)區(qū)第二幼兒園園長—...
    小荷何福不有閱讀 329評論 0 1