css3.0搶先看(一):border-radius圓角邊框

來源:互聯網
上載者:User

近來在國外的一些web學習網站上學習了些css3.0的新東東,組織了一下,打算分批寫下來。由於個人水平有限,難免有理解上的錯誤,歡迎大家指出我的錯誤。

     在css3中新增了很多功能和屬性,好多很酷很實用的功能。只是現在好多瀏覽器還都不支援,只有個別瀏覽器對某些屬性支援。現在開始介紹些有趣的吧。

    border-radius:用這個屬效能實現圓角邊框的效果。現在只有Mozilla/Firefox 和 Safari 3支援該屬性。請看下面的範例程式碼:

<div style=" background-color: #ccc;  -moz-border-radius: 5px;
-webkit-border-radius: 5px;
border: 1px solid #000;
padding: 10px;" >

實現的效果如下:

 

Mozilla/Firefox 和 Safari 3使用者將在這裡看到圓角邊框

此外,設計者還可以隨意指定圓角的位置,左上、左下、右上、右下四個方向。在mozilla/firefox和safari中的具體書寫格式如下:

  • -moz-border-radius-topleft / -webkit-border-top-left-radius
  • -moz-border-radius-topright / -webkit-border-top-right-radius
  • -moz-border-radius-bottomleft / -webkit-border-bottom-left-radius
  • -moz-border-radius-bottomright / -webkit-border-bottom-right-radius

實現的效果如下:
      Mozilla/Firefox 和Safari 3 中看到的左上圓角Mozilla/Firefox 和Safari 3 中看到的右上圓角Mozilla/Firefox 和Safari 3 中看到的左下圓角Mozilla/Firefox 和Safari 3 中看到的右下圓角

好吧,終於寫完border-radius了,沒發貼的經驗,寫起來真費勁,呵呵。下回還寫和border有關的,具體的再說啦。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.