Movatterモバイル変換


[0]ホーム

URL:


  1. 面向开发者的 Web 技术
  2. CSS:层叠样式表
  3. CSS 参考
  4. 属性
  5. border-image-repeat

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in EnglishAlways switch to English

border-image-repeat

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2016年3月.

border-image-repeat 定义图片如何填充边框。或为单个值,设置所有的边框;或为两个值,分别设置水平与垂直的边框。

语法

css
/* 关键字值 */border-image-repeat: stretch;border-image-repeat: repeat;border-image-repeat: round;border-image-repeat: space;/* 上、下 | 左、右 */border-image-repeat: round stretch;/* 全局值 */border-image-repeat: inherit;border-image-repeat: initial;border-image-repeat: revert;border-image-repeat: revert-layer;border-image-repeat: unset;

type

stretch,repeat,round,space 选一。属于单个值的情况。

horizontal

stretch,repeat,round,space 选一。属于两个值的情况。

vertical

stretch,repeat,round,space 选一。属于两个值的情况。

stretch

拉伸图片以填充边框。

repeat

平铺图片以填充边框。

round

平铺图像。当不能整数次平铺时,根据情况放大或缩小图像。

space

平铺图像。当不能整数次平铺时,会用空白间隙填充在图像周围(不会放大或缩小图像)

inherit

继承父级元素的计算值。

形式定义

初始值stretch
适用元素all elements, except internal table elements whenborder-collapse iscollapse. It also applies to::first-letter.
是否是继承属性
计算值as specified
动画类型离散值

形式语法

border-image-repeat =
[stretch|repeat|round|space]{1,2}

示例

不同的取值,查看border-image 的示例。

规范

Specification
CSS Backgrounds and Borders Module Level 3
# border-image-repeat

浏览器兼容性

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp