css中border(邊框) 屬性特點的介紹

來源:互聯網
上載者:User
本篇文章給大家帶來的內容是關於css中border(邊框) 屬性特點的介紹,有一定的參考價值,有需要的朋友可以參考一下,希望對你有所協助。

簡寫順序:width-style-color

eg:p{border:1px solid red;}

按簡寫順序依次介紹每個屬性特點:

一、border-width:medium(預設。中等):thin;thick;thick;length;inherit;

二、border-style:none(預設。無);hidden(與none相同,應用於表時除外,對於表用於解決邊框衝突);dotted(點狀邊框);dashed(虛線)、solid(實線);double(雙線);groove(3D凹槽);ridge(3D壟狀);inset(3D嵌入);outset(3D突出);inherit;

三、border-color:color(name,16進位,rgb);transparent:inherit.

四、border-radius:0(預設值);length(px);%;

還可以分開賦值:border-top-left-radius;border-top-right-radius;border-bottom-left-radius;border-bottom-right-radius;

五、border-image:source slice width outset repeat;省略的值為它們的預設值

eg:

div{    border-image:url(img.png) 30 30 round;    -webkit-border-image:url(img.png) 30 30 round;/*safari 5 and older*/    -o-border-image:url(img.png) 30 30 round;/*Opera*/}

六、box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2)

0.2表示透明度

注釋:ie9+支援border-radius和box-shadow屬性;firefox、chrome、opera以及safafi支援所有新邊框屬性(即:border-radius;border-image和box-shadow);對於border-image,safari5以及更老的版本需要首碼-webkit-,opera需要首碼-o-;

相關文章

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.