CSS3 圓角(border-radius)

來源:互聯網
上載者:User

標籤:stand   www   class   code   tom   back   likely   internet   idt   

首碼
  • -moz(例如 -moz-border-radius)用於Firefox
  • -webkit(例如:-webkit-border-radius)用於Safari和Chrome。

例1
<div id="round"></div>#round {    padding:10px; width:300px; height:50px;    border: 5px solid #dedede;    -moz-border-radius: 15px;      /* Gecko browsers */    -webkit-border-radius: 15px;   /* Webkit browsers */    border-radius:15px;            /* W3C syntax */}

效果:

例2:無邊框
<div id="round"></div>  #round {    padding:10px; width:300px; height:50px;    background:#FC9;     -moz-border-radius: 15px;    -webkit-border-radius: 15px;    border-radius:15px;}

效果:

書寫順序
/* Gecko browsers */-moz-border-radius: 5px; /* Webkit browsers */-webkit-border-radius: 5px; /* W3C syntax - likely to be standard so use for future proofing */border-radius:10px;

其它

支援上、右、下、左

border-radius:5px 15px 20px 25px;

支援拆分書寫

/* Gecko browsers */-moz-border-radius-topleft: 20px;-moz-border-radius-topright: 0;-moz-border-radius-bottomleft: 0;-moz-border-radius-bottomright: 20px; /* Webkit browsers */-webkit-border-top-left-radius: 20px;-webkit-border-top-right-radius: 0;-webkit-border-bottom-left-radius: 0;-webkit-border-bottom-right-radius: 20px; /* W3C syntax */border-top-left-radius: 20px;border-top-right-radius: 0;border-bottom-right-radius: 0;border-bottom-left-radius:  20px;

支援性
瀏覽器 支援性
Firefox(2、3+)
Google Chrome(1.0.154+…)
Google Chrome(2.0.156+…)
Safari(3.2.1+ windows)
Internet Explorer(IE7, IE8) ×
Opera 9.6 ×

CSS3 圓角(border-radius)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.