W3C中文教程
全球最大最新的中文 Web 技术教程
HTML CSS SQL PHP COLORS MYSQL BOOTSTRAP
×

CSS 参考手册

CSS 参考手册 CSS 选择器 CSS 函数参考手册 CSS 听觉参考手册 CSS Web安全字体 CSS 动画 CSS 单位 CSS 颜色 CSS3 浏览器支持

CSS 属性

align-content align-items align-self all animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function backface-visibility background background-attachment background-blend-mode background-clip background-color background-image background-origin background-position background-repeat background-size border border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-shadow box-sizing caption-side clear clip color column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width columns content counter-increment counter-reset cursor direction display empty-cells filter flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float font @font-face font-family font-size font-size-adjust font-stretch font-style font-variant font-weight hanging-punctuation height justify-content @keyframes left letter-spacing line-height list-style list-style-image list-style-position list-style-type margin margin-bottom margin-left margin-right margin-top max-height max-width @media min-height min-width nav-down nav-index nav-left nav-right nav-up opacity order outline outline-color outline-offset outline-style outline-width overflow overflow-x overflow-y padding padding-bottom padding-left padding-right padding-top page-break-after page-break-before page-break-inside perspective perspective-origin position quotes resize right tab-size table-layout text-align text-align-last text-decoration text-decoration-color text-decoration-line text-decoration-style text-indent text-justify text-overflow text-shadow text-transform top transform transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi vertical-align visibility white-space width word-break word-spacing word-wrap z-index

 

CSS3 border-image 属性


Example

将图像指定为元素周围的边框:

#borderimg {
    -webkit-border-image: url(border.png) 30round; /* Safari 3.1-5 */
    -o-border-image: url(border.png)30 round; /* Opera 11-12.1 */
    border-image: url(border.png)30 round;
}
尝试一下 »

定义及用法

border-image 属性允许您指定要使用的图像,而不是元素周围的正常边框。

border-image属性是速记属性用于设置 border-image-sourceborder-image-sliceborder-image-widthborder-image-outsetborder-image-repeat 的值。

省略的值设置为它们的默认值。

默认值: none 100% 1 0 stretch
继承:
可动画化: 否。 请参阅 animatable
版本: CSS3
JavaScript 语法: object.style.borderImage="url(border.png) 30 round" 尝 试

浏览器支持

表格中的数字表示支持该属性的第一个浏览器的版本号。

紧跟在 -webkit-,-moz- 或 -o- 前的数字为支持该前缀属性的第一个浏览器版本号。

属性
border-image 16.0
4.0 -webkit-
12.0 11.0 15.0
3.5 -moz-
6.0
3.1 -webkit-
15.0
11.0 -o-

CSS 语法

border-image: source slice width outset repeat|initial|inherit;

属性值

描述 演 示
border-image-source 用于指定要用于绘制边框的图像的位置。
border-image-slice 图像边界向内偏移。 演 示 »
border-image-width 图像边界的宽度。
border-image-outset 用于指定在边框外部绘制 border-image-area 的量。
border-image-repeat 用于设置图像边界是否应重复(repeated)、拉伸(stretched)或铺满(rounded)。 演 示 »
initial 将此属性设置为其默认值。请参阅 initial
inherit 从其父元素继承此属性。请参阅 inherit

Examples

更多实例

Example

#borderimg1 {
    border: 10px solid transparent;
   padding: 15px;
    -webkit-border-image: url(border.png)50 round; /* Safari 3.1-5 */
    -o-border-image: url(border.png)50 round; /* Opera 11-12.1 */
    border-image: url(border.png)50 round;
}

#borderimg2 {
   border: 10px solid transparent;
    padding: 15px;
   -webkit-border-image: url(border.png) 20% round; /* Safari 3.1-5 */
   -o-border-image: url(border.png) 20% round; /* Opera 11-12.1 */
   border-image: url(border.png) 20% round;
}

#borderimg3 {
    border: 10px solid transparent;
   padding: 15px;
    -webkit-border-image: url(border.png)30% round; /* Safari 3.1-5 */
    -o-border-image: url(border.png)30% round; /* Opera 11-12.1 */
    border-image: url(border.png)30% round;
}
尝试一下 »

相关文章

CSS3 教程:CSS3 Border Images

CSS 参考手册:border-image-outset 属性

CSS 参考手册:border-image-repeat 属性

CSS 参考手册:border-image-slice 属性

CSS 参考手册:border-image-source 属性

CSS 参考手册:border-image-width 属性

HTML DOM 参考手册:borderImage 属性