border प्रॉपर्टी का उपयोग किसी एलिमेंट के लिए बॉर्डर प्रॉपर्टीज को परिभाषित करने के लिए किया जाता है। यह border-width, border-style और border-color के लिए एक शॉर्टहैंड है।
सिंटैक्स
CSS border प्रॉपर्टी का सिंटैक्स निम्नानुसार है:
Selector { border: /*value*/ }
उदाहरण
निम्नलिखित उदाहरण CSS border प्रॉपर्टी को दर्शाते हैं:
<!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>
आउटपुट
यह निम्नलिखित आउटपुट देता है:
