本文介紹了用css3寫出氣球樣式的示例代碼,分享給大家,具體如下:
氣球效果圖:

html:
| <div class="ballon"></div> | 
css:
| .balloon{ width: 160px; height: 160px; background: #faf9f9; /*css3 圓角屬性*/ border-radius: 50% 50% 25% 50%; /*順時針旋轉(zhuǎn)45度*/ transform: rotate(45deg); /*盒子陰影 x位移 y位移 羽化 半徑 顏色 */ box-shadow: -8px -8px 80px -8px #873940 inset;}/*after before 偽元素*/.balloon::after{ position: absolute; bottom: 5px; right: 5px; content:""; display: block; /*width: 18px; height: 18px;*/ /*background: #873940;*/ /*transform: rotate(45deg);*/ border: 8px solid transparent; border-right-color: #873940; transform: rotate(45deg); border-radius: 50%;} | 
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持錯新站長站。
新聞熱點
疑難解答