CSS3圓角邊框和邊界圖片效果執行個體分享

來源:互聯網
上載者:User
本文的學習要點如下:

•圓角 border-radius
•盒陰影 box-shadow
•邊界圖片 border-image

1.圓角 border-radius

<div>border-radius 屬性允許您為元素添加圓角邊框! </div>    div {       width: 200px;       height: 100px;       padding:20px;       border: 1px solid red;       border-radius : 25px;      }

2.盒陰影 box-shadow

<div></div>    div {       width: 200px;       height: 100px;       background: red;       /*x軸位移量 y軸位移量 模糊程度 陰影顏色*/       box-shadow: 10px 10px 5px #000;   }

3.邊界圖片 border-image

html部分

<p><b>注意: </b> Internet Explorer 不支援 border-image 屬性。</p>  <p> border-image 屬性用於設定圖片的邊框。</p>    <div id="round">這裡,映像平鋪(重複)來填充該地區。</div>  <br>  <div id="stretch">這裡,映像被展開以填充該地區。</div>    <p>這是我們使用的圖片素材:</p>  <img src="images/border.png" />

css部分

div {       width: 250px;       padding: 10px 20px;       border: 15px solid translate;   }   #round {       /*safari*/      /*圖片源 圖片邊界向內位移量 圖片的寬度 用於指定在邊框外部繪製 border-image-area 的量  樣式*/      -webkit-border-image : url(../images/border.png) 30 30 round;       /*opera*/      -o-border-image : url(../images/border.png) 30 30 round;       border-image : url(../images/border.png) 30 30 round;   }     #stretch {       -webkit-border-image : url(../images/border.png) 30 30 stretch;       -o-border-image : url(../images/border.png) 30 30 stretch;       border-image : url(../images/border.png) 30 30 stretch;   }

聯繫我們

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