CSS圖形每日一練(下)

1. 心形(Heart)

#heart {
  position: relative;
  width: 100px;
  height: 90px;
}
#heart::before,
#heart::after {
  position: absolute;
  content: '';
  top: 0;
  left: 50px;
  width: 50px;
  height: 80px;
  background: red;
  border-radius: 50px 50px 0 0;
  transform: rotate(-45deg);
  transform-origin: 0 100%;
}
#heart::after {
  left: 0;
  transform: rotate(45deg);
  transform-origin: 100% 100%;
}
heart.png

2. 無窮(Infinity)

#infinity {
  position: relative;
  width: 212px;
  height: 100px;
  box-sizing: content-box;
}
#infinity::before,
#infinity::after {
  position: absolute;
  content: '';
  box-sizing: content-box;
  top: 0;
  left: 0;
  width: 60px;
  height: 60px;
  border: 20px solid red;
  border-radius: 50px 50px 0 50px;
  transform: rotate(-45deg);
}
#infinity::after {
  left: auto;
  right: 0;
  border-radius: 50px 50px 50px 0;
  transform: rotate(45deg);
}
infinity.png

3. 雞蛋形(Egg)

#egg {
  display: block;
  width: 126px;
  height: 180px;
  background: red;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}
egg.png

4. 吃豆人(Pac-Man)

#pacman {
  width: 0;
  height: 0;
  border: 60px solid red;
  border-right-color: transparent;
  border-radius: 60px;
}
pacman.png

5. 聊天框(Talk Bubble)

#talkbubble {
  width: 120px;
  height: 80px;
  background: red;
  border-radius: 10px;
  position: relative;
  margin: 0 20px;
}
#talkbubble::before {
  position: absolute;
  content: '';
  top: 26px;
  right: 100%;
  width: 0;
  height: 0;
  border-top: 13px solid transparent;
  border-right: 17px solid red;
  border-bottom: 13px solid transparent;
}
talkbubble.png

6. 六角星(Star (6-points))

#star-six {
  width: 0;
  height: 0;
  border-left: 50px solid transparent;
  border-right: 50px solid transparent;
  border-bottom: 100px solid red;
  position: relative;
}
#star-six::after {
  width: 0;
  height: 0;
  border-left: 50px solid transparent;
  border-right: 50px solid transparent;
  border-top: 100px solid red;
  position: absolute;
  content: '';
  top: 30px;
  left: -50px;
}
star-six.png

7. 五角星(Star(5-points))

#star-five {
  width: 0;
  height: 0;
  border-left: 100px solid transparent;
  border-right: 100px solid transparent;
  border-bottom: 70px solid red;
  position: relative;
  transform: rotate(35deg);
  margin: 60px 0;
}
#star-five::before {
  width: 0;
  height: 0;
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  border-bottom: 80px solid red;
  position: absolute;
  content: '';
  top: -45px;
  left: -65px;
  transform: rotate(-35deg);
}
#star-five::after {
  width: 0;
  height: 0;
  border-left: 100px solid transparent;
  border-right: 100px solid transparent;
  border-bottom: 70px solid red;
  position: absolute;
  content: '';
  top: 3px;
  left: -105px;
  transform: rotate(-70deg);
}
star-five.png

8. 爆炸形狀1(12 Point Burst)

#burst-12 {
  width: 80px;
  height: 80px;
  background: red;
  position: relative;
}
#burst-12::before,
#burst-12::after {
  position: absolute;
  content: '';
  top: 0;
  left: 0;
  width: 80px;
  height: 80px;
  background: red;
}
#burst-12::before {
  transform: rotate(30deg);
}
#burst-12::after {
  transform: rotate(60deg);
}
burst-12.png

9. 爆炸形狀2(8 Point Burst)

#burst-8 {
  width: 80px;
  height: 80px;
  background: red;
  position: relative;
  transform: rotate(20deg);
}
#burst-8::before {
  width: 80px;
  height: 80px;
  background: red;
  position: absolute;
  content: '';
  top: 0;
  left: 0;
  transform: rotate(135deg);
}
burst-8.png

10. 陰陽(Yin Yang)

#yin-yang {
  width: 100px;
  height: 100px;
  background: linear-gradient(to bottom, #000 0%,#000 50%,#fff 50%,#fff 100%);
  border-radius: 50%;
  border: 1px solid black;
  position: relative;
}
#yin-yang::before {
  position: absolute;
  content: '';
  top: 25px;
  left: 0;
  width: 10px;
  height: 10px;
  background: white;
  border-radius: 50%;
  border: 20px solid black;
  box-sizing: content-box;
}
#yin-yang::after {
  position: absolute;
  content: '';
  top: 25px;
  left: 50px;
  width: 10px;
  height: 10px;
  background: black;
  border: 20px solid white;
  border-radius: 50%;
  box-sizing: content-box;
}
yinyang.png

11. 徽章絲帶(Badge Ribbon)

#badge-ribbon {
  width: 100px;
  height: 100px;
  background: red;
  border-radius: 50px;
  position: relative;
}
#badge-ribbon::before,
#badge-ribbon::after {
  position: absolute;
  content: '';
  top: 70px;
  left: -10px;
  border-left: 40px solid transparent;
  border-right: 40px solid transparent;
  border-bottom: 70px solid red;
  transform: rotate(-140deg);
}
#badge-ribbon::after {
  left: auto;
  right: -10px;
  transform: rotate(140deg);
}
badge-ribbon.png

12. 電視屏幕(TV Screen)

#tv {
  width: 200px;
  height: 150px;
  position: relative;
  background: red;
  border-radius: 50% / 11%;
  margin: 10px;
}
#tv::before {
  position: absolute;
  content: '';
  top: 10%;
  bottom: 10%;
  left: -5%;
  right: -5%;
  background: inherit;
  border-radius: 5% / 50%;
}
tv.png

13. Chevron

#chevron {
  position: relative;
  height: 60px;
  width: 200px;
  padding: 12px;
  margin-bottom: 6px;
  box-sizing: border-box;
} 
#chevron::before {
  position: absolute;
  content: '';
  top: 0;
  left: 0;
  height: 100%;
  width: 51%;
  background: red;
  transform: skew(0,6deg);
}
#chevron::after {
  position: absolute;
  content: '';
  top: 0;
  right: 0;
  height: 100%;
  width: 50%;
  background: red;
  transform: skew(0,-6deg);
}
chevron.png

14. 放大鏡(Magnifying Glass)

#magnifying-glass {
  width: 0.4em;
  height: 0.4em;
  position: relative;
  font-size: 10em;
  border: 0.1em solid red;
  border-radius: 0.35em;
}
#magnifying-glass::before {
  position: absolute;
  content: '';
  right: -0.25em;
  bottom: -0.1em;
  width: 0.35em;
  height: 0.08em;
  background: red;
  transform: rotate(45deg);
}
magnifying-glass.png

15. 臉書圖標(biāo)(Facebook Icon)

#facebook-icon {
  background: red;
  width: 100px;
  height: 110px;
  border: 15px solid red;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  border-bottom: 0;
  box-sizing: content-box;
}
#facebook-icon::before {
  position: absolute;
  content: '';
  bottom: -30px;
  right: -37px;
  width: 40px;
  height: 90px;
  border: 20px solid #eee;
  border-radius: 25px;
  background: red;
  box-sizing: content-box;
}
#facebook-icon::after {
  position: absolute;
  content: '';
  top: 50px;
  right: 5px;
  width: 55px;
  height: 20px;
  background: #eee;
  box-sizing: content-box;
}
facebook-icon.png

16. 月亮(Moon)

#moon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  box-shadow: 15px 15px 0 0 red;
}
moon.png

17. 旗幟(Flag)

#flag {
  width: 110px;
  height: 56px;
  background: red;
  padding-top: 15px;
  box-sizing: content-box;
  position: relative;
}
#flag::after {
  position: absolute;
  content: '';
  left: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border-bottom: 13px solid #eeeeee;
  border-left: 55px solid transparent;
  border-right: 55px solid transparent;
}
flag.png

18. 圓錐形(Cone)

#cone {
  width: 0;
  height: 0;
  border-left: 70px solid transparent;
  border-right: 70px solid transparent;
  border-top: 100px solid red;
  border-radius: 50%;
}
cone.png

19. 十字(Cross)

#cross {
  width: 20px;
  height: 100px;
  background: red;
  position: relative;
  margin: 0 40px;
}
#cross::after {
  position: absolute;
  content: '';
  top: 40px;
  left: -40px;
  width: 100px;
  height: 20px;
  background: red;
}
cross.png

20. Base

#base {
  width: 100px;
  height: 55px;
  background: red;
  position: relative;
  margin-left: 20px;
  margin-top: 55px;
  display: inline-block;
}
#base::before {
  position: absolute;
  content: '';
  top: -35px;
  left: 0;
  width: 0;
  height: 0;
  border-bottom: 35px solid red;
  border-left: 50px solid transparent;
  border-right: 50px solid transparent;
}
base.png

參考鏈接

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子陕截,更是在濱河造成了極大的恐慌踪少,老刑警劉巖,帶你破解...
    沈念sama閱讀 218,284評論 6 506
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件卧斟,死亡現(xiàn)場離奇詭異殴边,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)珍语,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,115評論 3 395
  • 文/潘曉璐 我一進(jìn)店門锤岸,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人板乙,你說我怎么就攤上這事是偷。” “怎么了募逞?”我有些...
    開封第一講書人閱讀 164,614評論 0 354
  • 文/不壞的土叔 我叫張陵晓猛,是天一觀的道長。 經(jīng)常有香客問我凡辱,道長戒职,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,671評論 1 293
  • 正文 為了忘掉前任透乾,我火速辦了婚禮洪燥,結(jié)果婚禮上磕秤,老公的妹妹穿的比我還像新娘。我一直安慰自己捧韵,他們只是感情好市咆,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,699評論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著再来,像睡著了一般蒙兰。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上芒篷,一...
    開封第一講書人閱讀 51,562評論 1 305
  • 那天搜变,我揣著相機(jī)與錄音,去河邊找鬼针炉。 笑死挠他,一個胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的篡帕。 我是一名探鬼主播殖侵,決...
    沈念sama閱讀 40,309評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼镰烧!你這毒婦竟也來了拢军?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,223評論 0 276
  • 序言:老撾萬榮一對情侶失蹤怔鳖,失蹤者是張志新(化名)和其女友劉穎朴沿,沒想到半個月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體败砂,經(jīng)...
    沈念sama閱讀 45,668評論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡赌渣,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,859評論 3 336
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了昌犹。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片坚芜。...
    茶點(diǎn)故事閱讀 39,981評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖斜姥,靈堂內(nèi)的尸體忽然破棺而出鸿竖,到底是詐尸還是另有隱情,我是刑警寧澤铸敏,帶...
    沈念sama閱讀 35,705評論 5 347
  • 正文 年R本政府宣布缚忧,位于F島的核電站,受9級特大地震影響杈笔,放射性物質(zhì)發(fā)生泄漏闪水。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,310評論 3 330
  • 文/蒙蒙 一蒙具、第九天 我趴在偏房一處隱蔽的房頂上張望球榆。 院中可真熱鬧朽肥,春花似錦、人聲如沸持钉。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,904評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽每强。三九已至始腾,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間空执,已是汗流浹背浪箭。 一陣腳步聲響...
    開封第一講書人閱讀 33,023評論 1 270
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留脆烟,地道東北人山林。 一個月前我還...
    沈念sama閱讀 48,146評論 3 370
  • 正文 我出身青樓房待,卻偏偏與公主長得像邢羔,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子桑孩,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,933評論 2 355

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

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,332評論 0 10
  • **2014真題Directions:Read the following text. Choose the be...
    又是夜半驚坐起閱讀 9,505評論 0 23
  • 敬畏—進(jìn)入—體驗(yàn)—交給—持續(xù) 1,缺啥補(bǔ)啥拜鹤,怕啥練啥; 2,一切為我所用流椒,所用為團(tuán)隊(duì)家敏簿; 3,我想變宣虾,我要變惯裕,我...
    京心達(dá)閱讀 75評論 0 0
  • 低質(zhì)量的社交,不如高質(zhì)量的獨(dú)處绣硝。 在中國的傳統(tǒng)文化中蜻势,世故人情和人脈總是聯(lián)系在一起,總是在很多關(guān)鍵時刻化腐朽為神奇...
    詩享者閱讀 198評論 0 1
  • class文件是一組以八字節(jié)為基礎(chǔ)單位的二進(jìn)制流鹉胖,class文件格式采用c語言的偽結(jié)構(gòu)來存儲數(shù)據(jù)握玛,它一共有兩種數(shù)據(jù)...
    小小少年Boy閱讀 237評論 0 2