css圓角邊框代碼怎麼寫?(程式碼範例)

來源:互聯網
上載者:User
本篇文章主要給大家介紹css邊框效果怎麼實現的。

css圓角邊框代碼具體樣本如下:

<!DOCTYPE HTML><html lang="en"><head>    <title>css圓角邊框代碼執行個體</title>    <meta charset="UTF-8">    <style type="text/css">        div {            color: white;            text-align:center;            border:2px solid #a1a1a1;            padding:10px 40px;            background: #029789;            width:350px;            border-radius:25px;            -moz-border-radius:25px; /* 老的 Firefox */ }    </style></head><body><div>css邊框設定使用border-radius 屬性即可向元素添加圓角。</div></body></html>

效果如:

這裡涉及主要的屬性就是border-radius,利用此屬性可進行css圓角邊框調節的功能。

註:border-radius的使用方法:

border-radius: 1-4 length|% / 1-4 length|%;

按此順序設定每個 radii 的四個值。如果省略 bottom-left,則與 top-right 相同。如果省略 bottom-right,則與 top-left 相同。如果省略 top-right,則與 top-left 相同。

-webkit-border-radius 是為了相容 chrome 或 safari。

-moz-border-radius 是為了相容Firefox。

相關文章

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.