日本一卡精品视频免费丨国产午夜片无码区在线播放丨国产精品成人久久久久久久丨国产亚洲日韩av在线播放不卡丨亚洲日韩av无码

css3圓角介紹與應用技巧

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

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

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

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

<!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; /* 邊長的一半 */ 
            box-sizing: border-box; 
            padding:0 5px; 
        } 
    </style> 
</head> 
<body> 
    <div class="borderRadius"> 
       <div class="innerTxt"></div> 
    </div> 
</body> 
</html>

顯示效果如下:

以上布局當我們在innerTxt中添加過多的內(nèi)容時,會得到如下的效果:

如果我們想要一個自適應的橢圓的話,那么border-radius中就不應該是一個固定的值,
當我們將border-radius設置為50%時,顯示效果如下:

這樣就變成了一個自適應的橢圓了。

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

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

結(jié)合這這些特性來看的話,border-radius:50%;的詳細展開應該是border-radius:50% 50% 50% 50%/50% 50% 50% 50%。

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

  border-radius: 50% / 100% 100% 0 0(當圓角半徑不滿4個時,css會自動幫你重復)

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

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

糖果按鈕

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

.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%; 
        }

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

主站蜘蛛池模板: 欧美、另类亚洲日本一区二区| 老女老肥熟国产在线视频| 丰满熟女人妻中文字幕免费 | 成年人黄色免费网站| 麻花豆传媒剧国产免费mv入口| 麻豆丰满少妇chinese| 久久人人爽人人爽人人片ⅴ| 精品 日韩 国产 欧美 视频| 日本久久亚洲| 国产香蕉尹人视频在线| 国产三级无码内射在线看| 久久免费小视频| 久久久久久人妻一区精品| 久草在线资源福利| 午夜时刻免费入口| 国产精品调教视频一区| 亚洲成在人网站无码天堂| 精品久久久久久人妻无码中文字幕| 久久久久99精品成人片| 91黄色免费视频| 免费观看全黄做爰的视频| 亚洲精品av少妇一区二区| 爱久久av一区二区三区| 三级不卡| 一本加勒比hezyo中文无码| 69久久精品| 一二三四在线观看免费视频| 在线观看黄色国产| 99久久无码一区人妻a黑| 国产一区二区欧美日韩| 人妻少妇精品久久久久久| 国产成人片无码视频在线观看| 性折磨bdsm欧美激情另类| 在厨房拨开内裤进入在线视频| 2020亚洲欧美国产日韩| 老子影院午夜伦不卡| 成人av中文字幕| 一本av高清一区二区三区|