添加 CSS3 边框图片

cssweb developmentfront end technology更新于 2024/12/10 11:56:17

要在 CSS3 中添加边框图片,请使用 border-image 属性。它是以下属性的简写形式 −

border-image-source
border-image-slice
border-image-width
border-image-outset
border-image-repeat

这些值可以设置为:

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

示例

现在来看一个例子 −

<!DOCTYPE html>
<html>
<head>
<style>
#demo {
   border: 20px solid;
   padding: 20px;
   border-image: url(https://www.cainiaomax.com/images/home_ai_python.png) 20 round;
}
</style>
</head>
<body>
<h1>PyTorch Tutorial</h1>
<p>PyTorch is an open source machine learning library for Python and is completely based on Torch.</p>
<p id="demo">It is primarily used for applications such as natural language processing.</p>
</body>
</html>

输出

示例

现在让我们看另一个例子 −

<!DOCTYPE html>
<html>
<head>
<style>
#demo {
   border: 20px solid;
   padding: 20px;
   border-image: url(https://www.cainiaomax.com/images/home_pytorch.png) 40% round;
}
</style>
</head>
<body>
<h1>TensorFlow Tutorial</h1>
<p>TensorFlow is an open source machine learning framework for all developers. It is used for implementing machine learning and deep learning applications.</p>
<p id="demo"> To develop and research on fascinating ideas on artificial intelligence, Google team created TensorFlow. </p>
</body>
</html>

输出


相关文章


有用资源