css3繪製谷歌圖示程式碼例項
分享一段程式碼例項,它實現了利用css3繪製谷歌圖示效果。
程式碼例項如下:
[HTML] 純文字檢視 複製程式碼<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="author" content="http://www.softwhy.com/" /> <title>螞蟻部落</title> <style> .box { width: 300px; height: 300px; position: absolute; left: 0; right: 0; top: 0; bottom: 0; margin: auto; border-radius: 100%; box-shadow: 0 0 10px rgba(0,0,0,0.1); overflow: hidden; } .box::before { content: ""; position: absolute; width: 100px; height: 100px; background: #4c8bf5; border: 10px solid #fff; border-radius: 100%; top: 0; left: 0; bottom: 0; right: 0; margin: auto; z-index: 111; } .red { width: 300px; height: 150px; position: absolute; background: #E65141; top: -50px; left: 150px; } .red::before { content: ""; position: absolute; width: 300px; height: 150px; background: #E65141; left: -180px; transform: rotate(-60deg); } .green { background: #4CB749; width: 300px; height: 150px; position: absolute; transform: rotate(240deg); left: -110px; bottom: 10px; } .green::before { content: ""; position: absolute; width: 300px; height: 150px; background: #4CB749; right: 136px; transform: rotate(-60deg); bottom: -120px; } .yellow { background: #FCD209; width: 300px; height: 91px; position: absolute; right: -140px; bottom: 118px; } .yellow::before { content: ""; position: absolute; width: 300px; height: 150px; background: #FCD209; right: 70px; bottom: -180px; transform: rotate(120deg); } </style> </head> <body> <div class="box"> <div class="red"></div> <div class="green"></div> <div class="yellow"></div> </div> </body> </html>
相關文章
- css3繪製QQ企鵝圖示程式碼例項CSSS3
- css3繪製心形圖案程式碼例項CSSS3
- CSS3繪製菱形程式碼例項CSSS3
- CSS3繪製太極圖程式碼例項詳解CSSS3
- css3繪製月牙效果程式碼例項CSSS3
- css3實現的谷歌瀏覽器圖示程式碼例項CSSS3谷歌瀏覽器
- CSS3繪製平行四邊形程式碼例項CSSS3
- css3繪製柳樹葉形狀程式碼例項CSSS3
- javascript繪製心形圖案程式碼例項JavaScript
- canvas繪製扇形程式碼例項Canvas
- canvas繪製星星程式碼例項Canvas
- canvas 繪製雞蛋程式碼例項Canvas
- highcharts繪製柱狀圖程式碼例項
- canvas繪製網格程式碼例項Canvas
- css繪製圓形程式碼例項CSS
- svg繪製半圓程式碼例項SVG
- canvas繪製笑臉程式碼例項Canvas
- canvas繪製圓環效果程式碼例項Canvas
- highcharts繪製折線資料圖程式碼例項
- border-radius繪製圓形圖案程式碼例項
- SVG拖動繪製矩形程式碼例項SVG
- canvas繪製米字旗程式碼例項Canvas
- canvas繪製箭頭效果程式碼例項Canvas
- jQuery繪製網格效果程式碼例項jQuery
- canvas繪製拋物線程式碼例項Canvas線程
- canvas繪製機器貓程式碼例項Canvas
- canvas繪製夜空小屋效果程式碼例項Canvas
- canvas繪製鐘錶效果程式碼例項Canvas
- canvas繪製圓角矩形程式碼例項Canvas
- canvas繪製橢圓效果程式碼例項Canvas
- canvas繪製熊貓頭像程式碼例項Canvas
- 資料流圖繪製例項
- Python例項:僅繪製圖例而不繪製實際的圖形Python
- css3實現的天氣型別圖示程式碼例項CSSS3型別
- canvas繪製魚吃豆效果程式碼例項Canvas
- canvas繪製雪花飄落效果程式碼例項Canvas
- js按住滑鼠繪製線條程式碼例項JS
- canvas繪製圓形鐘錶程式碼例項Canvas