CSS Border-Color Property

In this chapter you will learn:
About border-color property
Example of this property

CSS border-color property is used to specify the color of the border of the element or tag to display the scope of the element in a different look and feel. It helps to create an attractive web page.

Example of this property:-

Example 1. border-color of paragraph


  1. <html>
  2. <head>
  3. <style type="text/css">
  4. p
  5. {
  6. border-style:solid;
  7. border-color:Blue;
  8. }
  9. </style>
  10. </head>
  11. <body>
  12. <p> This is the example of border-colorproperty of css.
  13. </p>
  14. </body>
  15. </html>

Output:- example of border-color property Note:-

Border-color property can only work if you have used a border-style property of the tag/element.

Example 2. border-color of div
  1. <html>
  2. <head>
  3. <style type="text/css">
  4. div
  5. {
  6. border-style:solid;
  7. border-color:green;
  8. width:200px;
  9. height:160px;
  10. }
  11. </style>
  12. </head>
  13. <body>
  14. <div> This is the example of border-color property of css.
  15. </div>
  16. </body>
  17. </html>

Output:- example of border-color property of div

Summary

In this chapter, you have learned about the border-color property of CSS which will help you to create an attractive web page. Click on next button to continue-

 

Share your thought