<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
        問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
        當前位置: 首頁 - 科技 - 知識百科 - 正文

        CSS制作各種各樣的網頁圖標方法實例

        來源:懂視網 責編:小OO 時間:2020-11-27 18:48:45
        文檔

        CSS制作各種各樣的網頁圖標方法實例

        三角形;<;p class=";box";>;<;/p>;<;style>;.box{ width: 0;height: 0;border-top: 50px solid transparent;border-bottom: 50px solid transparent;border-left: 50px solid transparent;border-right: 50px solid red;}<;/style>;。平行四邊形圖標;
        推薦度:
        導讀三角形;<;p class=";box";>;<;/p>;<;style>;.box{ width: 0;height: 0;border-top: 50px solid transparent;border-bottom: 50px solid transparent;border-left: 50px solid transparent;border-right: 50px solid red;}<;/style>;。平行四邊形圖標;
        本文主要和大家介紹了純CSS制作各種各樣的網頁圖標(三角形、暫停按鈕、下載箭頭、加號等)的相關資料,小編覺得挺不錯的,現在分享給大家,也給大家做個參考,希望能幫助到大家。

        三角形

        <p class="box"></p>
        <style>
        .box{
         width: 0;
         height: 0;
         border-top: 50px solid transparent;
         border-bottom: 50px solid transparent;
         border-left: 50px solid transparent;
         border-right: 50px solid red;
        }
        </style>

        平行四邊形圖標

        <p class="box"></p>
        <style>
         .box{
         width: 50px;
         height: 50px;
         margin: 100px auto;
         background-color: red;
         transform: skew(-25deg);
         }
        </style>

        暫停按鈕

        <p class="box"></p>
         <style>
         .box{
         width: 50px;
         height: 50px;
         margin: 100px auto;
         color: #000;
         border: 1px solid;
         border-radius: 50%;
         outline: 10px solid;
         outline-offset: -26px;
         }
         </style>

        暫停按鈕的實現原理就是邊框用border,里面的正方形用outline。因為outline有一個offset屬性可以用來設置偏移量,并且是按照比例來的。

        其實如果再將outline-offset的值設置小一點,一個加好就出來了

        加號

        <p class="box"></p>
        <style>
         .box{
         width: 50px;
         height: 50px;
         margin: 100px auto;
         color: #000;
         border: 1px solid;
         border-radius: 50%;
         outline: 10px solid;
         outline-offset: -35px;
         }
        </style>

        如果再將其旋轉,就變成了一個關閉按鈕

        關閉按鈕

        <p class="box"></p>
        <style>
         .box{
         width: 50px;
         height: 50px;
         margin: 100px auto;
         color: #000;
         border: 1px solid;
         border-radius: 50%;
         outline: 10px solid;
         outline-offset: -35px;
         transform: rotate(45deg);
         }

        漢堡按鈕

        <p class="box"></p>
        <style>
         .box{
         width: 50px;
         height: 0px;
         margin: 100px auto;
         box-shadow: 36px 10px 0 3px red,
         36px 0 0 3px red,
         36px 20px 0 3px red;
         }
        </style>

        漢堡按鈕2:

        <p class="box"></p>
        <style>
         .box{
         width: 30px;
         height: 3px;
         margin: 100px auto;
         padding: 2px 0;
         border-top: 3px solid red;
         border-bottom: 3px solid red;
         background-clip: content-box;
         background-color: red;
         }
        </style>

        單選按鈕

        因為box-shadow會按比例縮放,因此將第一個值設置為白色,然后將第二個值設置的比第一個值大就可以了

        <p class="box"></p>
        <style>
         .box{
         width: 30px;
         height: 30px;
         margin: 100px auto;
         background-color: #000;
         border-radius: 50%;
         box-shadow: 0 0 0 5px #fff,0 0 0 10px #000;
         }
        </style>

        圓圈中帶個十字

        <p class="box"></p>
        <style>
         .box {
         width: 30px;
         height: 30px;
         margin: 100px auto;
         background-color: #000;
         border-radius: 50%;
         box-shadow: 0 0 0 5px #fff, 0 0 0 10px #000;
         outline: 36px solid #fff;
         outline-offset: -50px;
         }
        </style>

        田型圖標

        <p class="box"></p>
        <style>
         .box {
         width: 0;
         margin: 100px auto;
         border: 3px solid red;
         outline: 6px dotted red;
         outline-offset: 6px;
         }
        </style>

        下載箭頭

        使用border制作三角形,使用box-shadow制作正方形,主要用了偏移

        <p class="box"></p>
        <style>
         .box {
         width: 0;
         margin: 100px auto;
         color: red;
         border: 8px solid transparent;
         border-top: 8px solid red;
         box-shadow: 0 -12px 0 -4px;
         }
        </style>

        書簽

        實現這種效果的原理就是講三角形設置成背景色,這樣空心的三角形就出現了

        <p class="box"></p>
        <style>
         .box {
         width: 0;
         height: 8px;
         background-color:orange;
         border: 8px solid transparent;
         border-bottom: 8px solid #fff;
         }
        </style>

        兩個半圓圖標

        這個比較簡單,就是通過漸變函數來實現,然后來個圓角邊框

        <p class="box"></p>
        <style>
         .box {
         width: 50px;
         height: 50px;
         border-radius: 50%;
         background-image: linear-gradient(to right,#ccc 50%,#000 50%);
         }
        </style>

        禁用圖標

        外圈利用圓角邊框,里面的豎線用漸變來做,然后再用旋轉屬性即可

        <p class="box"></p>
        <style>
         .box {
         width: 50px;
         height: 50px;
         border-radius: 50%;
         border:2px solid #000;
         background: linear-gradient(to right,#fff 45%,#000 45%,#000 45%,#fff 55%);
         transform: rotate(40deg);
         }
        </style>

        左右箭頭圖標

        既然能做出一個三角形,那么就可以做出兩個三角形。

        <p class="box"></p>
        <style>
         .box {
         width: 0;
         height: 0;
         margin: 100px auto;
         border: 10px solid transparent;
         border-left: 10px solid red;
         -webkit-box-reflect: left 5px;
         box-reflect:left 5px;
         }
        </style>

        需要在Chrome瀏覽器中打開,因為其他瀏覽器或許不支持

        鷹嘴圖標

        <p class="box"></p>
        <style>
         .box {
         width: 32px;
         margin: 100px auto;
         border-top: 50px solid transparent;
         border-right: 22px solid #096;
         border-bottom-right-radius: 100%;;
         }
        </style>

        聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        CSS制作各種各樣的網頁圖標方法實例

        三角形;<;p class=";box";>;<;/p>;<;style>;.box{ width: 0;height: 0;border-top: 50px solid transparent;border-bottom: 50px solid transparent;border-left: 50px solid transparent;border-right: 50px solid red;}<;/style>;。平行四邊形圖標;
        推薦度:
        標簽: 圖標 網站 制作
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 国产人妖ts在线观看免费视频| 午夜视频在线观看免费完整版| 亚洲人成色77777在线观看大| 亚洲AV无码国产精品永久一区| 曰皮全部过程视频免费国产30分钟| 国产精品亚洲综合久久| 老司机在线免费视频| 亚洲一区在线观看视频| 午夜两性色视频免费网站| 亚洲精品无码少妇30P| 国产美女做a免费视频软件| 免费看美女午夜大片| 区久久AAA片69亚洲| 精品一区二区三区免费| 亚洲一区二区影院| 99久久精品日本一区二区免费| 亚洲一级特黄特黄的大片| 国产无遮挡吃胸膜奶免费看视频| 羞羞视频免费网站含羞草| 亚洲午夜久久久影院| 无码国产精品一区二区免费vr| 亚洲福利电影在线观看| 在线观看人成网站深夜免费| 羞羞视频免费网站含羞草| 亚洲AV无码专区在线播放中文| 5g影院5g天天爽永久免费影院| 亚洲中文字幕一二三四区苍井空 | 性xxxx视频免费播放直播| 亚洲国产日产无码精品| 好大好硬好爽免费视频| 免费人成大片在线观看播放| 亚洲αv在线精品糸列| 丁香花在线观看免费观看| 日韩在线观看视频免费| 久久久久久久亚洲Av无码 | 免费福利在线播放| 亚洲AV成人无码久久WWW| 亚洲av无码精品网站| 午夜免费福利影院| 无码人妻一区二区三区免费看| 亚洲欧洲AV无码专区|