欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

css中border(边框) 属性特点的介绍

程序员文章站 2022-05-17 10:24:29
...
本篇文章给大家带来的内容是关于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-;

相关推荐:

关于css中的border-collapse_html/css_WEB-ITnose

CSS border-left-color属性_html/css_WEB-ITnose

以上就是css中border(边框) 属性特点的介绍的详细内容,更多请关注其它相关文章!

相关标签: css border