Computer >> 컴퓨터 >  >> 프로그램 작성 >> CSS

CSS3 테두리 이미지 추가

<시간/>

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.tutorialspoint.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>

출력

CSS3 테두리 이미지 추가

예시

이제 다른 예를 살펴보겠습니다 -

<!DOCTYPE html>
<html>
<head>
<style>
#demo {
   border: 20px solid;
   padding: 20px;
   border-image: url(https://www.tutorialspoint.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>

출력

CSS3 테두리 이미지 추가