1、
<style>
*{
margin: 0;
padding: 0;
}
body{
background-color: #000;
}
div{
position: absolute;
left: calc(50% - 50px);
top: calc(50% - 50px);
width: 100px;
height: 100px;
border: 10px solid black;
/* 支持渐变色 */
border-color: lightpink;
border-image-source: linear-gradient(red,yellow);
/* border-image-source:url(source/border.png);:用图片填充 */
border-image-slice: 10;
/* border-image-slice: 100%;也可以这样写 ,但最好不要写%,slice一定要随着border-image出场!!!*/
border-image-width: auto;
/* 填auto是看slice值=10px,填数字是多少倍 */
border-image-outset: 100px;/* 规定边框图像超过边框盒的量 */
/* stretch:默认值拉伸 repeat:平铺(不负责任,分散),相当于复制 round:负责任,拉伸的过程中,会随时复制一个元素,很规整
space:空格大到一定程度,才能加入新的元素,先拿空白补 */
border-image-repeat: stretch;
}
</style>
</head>
<body>
<div></div>
</body>