테두리 속성은 요소의 테두리 속성을 정의하는 데 사용됩니다. border-width, border-style 및 border-color의 약어입니다.
구문
CSS 테두리 속성의 구문은 다음과 같습니다 -
Selector {
border: /*value*/
} 예시
다음 예는 CSS 테두리 속성을 보여줍니다 -
<!DOCTYPE html>
<html>
<head>
<style>
img {
margin-top: 14px;
margin-left: 30px;
border: 2px solid orange;
box-shadow: 0 0 12px 1px black;
}
#demo {
border: 4px dotted magenta;
}
</style>
</head>
<body>
<img src="https://www.tutorialspoint.com/swing/images/swing-mini-logo.jpg">
<img id="demo" src="https://www.tutorialspoint.com/scala/images/scala-mini-logo.jpg">
</body>
</html> 출력
이것은 다음과 같은 출력을 제공합니다 -

예시
<!DOCTYPE html>
<html>
<head>
<style>
table {
margin: 1em;
border: 3px dashed green;
}
td {
font-size: 24px;
border: 2px double navy;
}
</style>
</head>
<body>
<table>
<tr>
<td>This</td>
<td>text</td>
</tr>
<tr>
<td>is</td>
<td>demo</td>
</tr>
</table>
</body>
</html>입니다. 출력
이것은 다음과 같은 출력을 제공합니다 -
