使用 CSS 对边框图像进行切片

cssweb developmentfront end technology更新于 2025/3/18 14:36:17

border-image-slice 属性用于使用 CSS 对边框图像进行切片。您可以尝试运行以下代码来实现 border-image-slice 属性:

示例

<html>
   <head>
      <style>
         #borderimg1 {
            border: 15px solid transparent;
            padding: 15px;
            border-image-source: url(https://tutorialspoint.com/css/images/border.png);
            border-image-repeat: round;
            border-image-slice: 40;
         }
      </style>
   </head>
   <body>
      <p id = "borderimg1">This is image border example.</p>
   </body>
</html>

相关文章


有用资源