<strike id="3tkic"><sup id="3tkic"></sup></strike>

  1. <ul id="3tkic"></ul>
      <b id="3tkic"><legend id="3tkic"></legend></b>
      <b id="3tkic"><meter id="3tkic"></meter></b>

    • <strike id="3tkic"></strike>

      <blockquote id="3tkic"></blockquote>

    • 亚洲AV无码国产在丝袜线观看_亚洲第一页A∨在线_亚洲国产人成在线观看69网站_无码日韩人妻AV一区免费l

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

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

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

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

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

      <!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>

      顯示效果如下:

      以上布局當(dāng)我們?cè)趇nnerTxt中添加過多的內(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è)簡寫屬性,
      它的展開式是border-top-left-radius、border-top-right-radius、border-bottom-right-radius、border-bottom-left-radius。

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

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

        接下來我們根據(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)造出可愛的糖果按鈕效果了。

      .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)常勞煩美工同志做圖啦,
      但是在應(yīng)用之前一定要確認(rèn)適用的游覽器支持圓角屬性。

      亚洲AV无码国产在丝袜线观看_亚洲第一页A∨在线_亚洲国产人成在线观看69网站_无码日韩人妻AV一区免费l
      <strike id="3tkic"><sup id="3tkic"></sup></strike>

      1. <ul id="3tkic"></ul>
          <b id="3tkic"><legend id="3tkic"></legend></b>
          <b id="3tkic"><meter id="3tkic"></meter></b>

        • <strike id="3tkic"></strike>

          <blockquote id="3tkic"></blockquote>

        • 泸州市| 乡城县| 宁乡县| 丹寨县| 合山市| 龙口市| 云安县| 石家庄市| 军事| 静宁县| 双鸭山市| 潜江市| 珲春市| 石屏县| 贡山| 庆元县| 平陆县| 平塘县| 海门市| 正镶白旗| 巫溪县| 饶阳县| 孝义市| 汶上县| 丽水市| 石林| 新绛县| 百色市| 克拉玛依市| 应用必备| 永福县| 新营市| 治多县| 卓尼县| 仪征市| 淳化县| 疏附县| 元阳县| 五寨县| 湛江市| 阿勒泰市|