• <tbody id="9je1r"></tbody><tbody id="9je1r"><acronym id="9je1r"><rp id="9je1r"></rp></acronym></tbody>
      • <acronym id="9je1r"><acronym id="9je1r"><rp id="9je1r"></rp></acronym></acronym>

        亚洲无码Aⅴ,视频1页精品,欧美系列一区二区,曰韩色999

        css3圓角介紹與應(yīng)用技巧

        2016/12/7 8:43:06   閱讀:1737    發(fā)布者:1737

        *以下技巧均源自于Lea Verou所著《CSS Secrets》

        自適應(yīng)橢圓與圓角構(gòu)造

          在css上構(gòu)造圓形只需要將border-radius屬性值設(shè)為邊長(zhǎng)的一半即可。

        <!DOCTYPE html> 
        <html lang="en"> 
        <head> 
            <meta charset="UTF-8"> 
            <title>border-radius</title> 
            <style> 
                .borderRadius{ 
                    display: inline-block; 
                    background: #fb3; 
                    min-width: 200px; 
                    height: 200px; 
                    line-height: 200px; 
                    border-radius: 100px; /* 邊長(zhǎng)的一半 */ 
                    box-sizing: border-box; 
                    padding:0 5px; 
                } 
            </style> 
        </head> 
        <body> 
            <div class="borderRadius"> 
               <div class="innerTxt"></div> 
            </div> 
        </body> 
        </html>

        顯示效果如下:

        以上布局當(dāng)我們?cè)趇nnerTxt中添加過(guò)多的內(nèi)容時(shí),會(huì)得到如下的效果:

        如果我們想要一個(gè)自適應(yīng)的橢圓的話,那么border-radius中就不應(yīng)該是一個(gè)固定的值,
        當(dāng)我們將border-radius設(shè)置為50%時(shí),顯示效果如下:

        這樣就變成了一個(gè)自適應(yīng)的橢圓了。

        這里我們?nèi)娼榻B一下border-radius的屬性,border-radius是一個(gè)簡(jiǎn)寫(xiě)屬性,
        它的展開(kāi)式是border-top-left-radius、border-top-right-radius、border-bottom-right-radius、border-bottom-left-radius。

        它還有一個(gè)鮮為人知的特性:border-radius可以單獨(dú)指定水平和垂直半徑,
        只要用一個(gè)斜杠( / )分隔這兩個(gè)值即可
        (圓形圓角水平和垂直半徑相等,可以合并)。

        結(jié)合這這些特性來(lái)看的話,border-radius:50%;的詳細(xì)展開(kāi)應(yīng)該是border-radius:50% 50% 50% 50%/50% 50% 50% 50%。

          接下來(lái)我們根據(jù)已知的圓角特性發(fā)揮想象構(gòu)建各種各樣的圖形。

          border-radius: 50% / 100% 100% 0 0(當(dāng)圓角半徑不滿4個(gè)時(shí),css會(huì)自動(dòng)幫你重復(fù))

          border-radius: 100% 0 0 100% / 50%;

          border-radius: 100% 0 0 0 / 100% 0 0 0;

        糖果按鈕

        當(dāng)實(shí)際應(yīng)用時(shí),充分利用圓角的特性加上一些想象,就可以構(gòu)造出可愛(ài)的糖果按鈕效果了。

        .borderRadius{ 
                    display: inline-block; 
                    background: rgba(255,160,220,.8); 
                    box-shadow: hsl(0, 0%, 60%) 0 3px 3px; 
                    min-width: 200px; 
                    height: 100px; 
                    line-height: 200px; 
                    border-radius: 50% 10% / 100% 10%; 
                }

        .borderRadius{ 
                    display: inline-block; 
                    background: rgba(157, 255, 127, 0.8); 
                    box-shadow: hsl(0, 0%, 60%) 0 3px 3px; 
                    min-width: 160px; 
                    height: 100px; 
                    line-height: 200px; 
                    border-radius: 20% 20% 12% 12%/ 80% 80% 12% 12%; 
                }

        .borderRadius{ 
                    display: inline-block; 
                    background: rgba(167, 255, 250, 0.8); 
                    box-shadow: hsl(0, 0%, 60%) 0 3px 3px; 
                    min-width: 160px; 
                    height: 100px; 
                    line-height: 200px; 
                    border-radius: 20% / 50%; 
                }

        是不是挺可愛(ài)的,這樣就不用經(jīng)常勞煩美工同志做圖啦,
        但是在應(yīng)用之前一定要確認(rèn)適用的游覽器支持圓角屬性。

        亚洲无码Aⅴ,视频1页精品,欧美系列一区二区,曰韩色999
            • <tbody id="9je1r"></tbody><tbody id="9je1r"><acronym id="9je1r"><rp id="9je1r"></rp></acronym></tbody>
            • <acronym id="9je1r"><acronym id="9je1r"><rp id="9je1r"></rp></acronym></acronym>
              休宁县| 五华县| 庆城县| 平乡县| 永登县| 东台市| 兴文县| 繁昌县| 商城县| 潍坊市| 张北县| 根河市| 体育| 彭阳县| 夹江县| 锡林浩特市| 徐闻县| 桓仁| 辉南县| 沙田区| 寻乌县| 晋城| 涿鹿县| 利辛县| 勐海县| 富裕县| 榆树市| 中西区| 阜南县| 蕲春县| 邵阳县| 蕉岭县| 宜宾市| 贵德县| 正阳县| 沙雅县| 灯塔市| 齐齐哈尔市| 新绛县| 健康| 连云港市|