CSS बॉर्डर प्रॉपर्टी का उपयोग किसी तत्व के बॉर्डर प्रॉपर्टीज को परिभाषित करने के लिए किया जाता है। यह सीमा-चौड़ाई, सीमा-शैली और सीमा-रंग के लिए एक आशुलिपि है। हम बॉर्डर-टॉप, बॉर्डर-राइट, आदि जैसे साइड-विशिष्ट गुणों का उपयोग करके अलग-अलग पक्षों को स्टाइल कर सकते हैं।
सिंटैक्स
CSS बॉर्डर प्रॉपर्टी का सिंटैक्स इस प्रकार है -
Selector {
border: /*value*/
} उदाहरण
निम्नलिखित उदाहरण CSS बॉर्डर प्रॉपर्टी को दर्शाते हैं -
<!DOCTYPE html>
<html>
<head>
<style>
div {
border-style: solid;
margin: auto;
padding: 5px;
border-radius: 50%;
}
#main {
height: 100px;
width: 100px;
border-left: 12px ridge goldenrod;
border-right: 12px ridge goldenrod;
}
#main > div {
line-height: 12px;
height: 30px;
width: 10px;
padding: 27px 20px;
border-top: 6px groove crimson;
border-bottom: 6px ridge crimson;
}
</style>
</head>
<body>
<div id="main">
<div>i see you</div>
</div>
</body>
</html> आउटपुट
यह निम्न आउटपुट देता है -

उदाहरण
<!DOCTYPE html>
<html>
<head>
<style>
p {
width: 60%;
margin: auto;
padding: 20px 45px;
border-top-width: 1.4em;
border-top-style: solid;
border-top-color: violet;
border-radius: 85px 85px 0 0;
color: black;
font-size: 1.3em;
background-image: url("https://www.tutorialspoint.com/images/css.png");
}
</style>
</head>
<body>
<p>CSS is used to control the style of a web document in a simple way. It handles the look and feel part of a web page.</p>
</body>
</html> आउटपुट
यह निम्न आउटपुट देता है -
