How to add a border colour | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to add a border colour

11th Feb 2017, 4:45 AM
Anji Shukla
Anji Shukla - avatar
5 Answers
+ 3
Using border-color property you can set the color of four borders. Note: Always declare the border-style property before the border-color property. An element must have borders before you can change the color Examples: border-color: red green blue pink; top border is red, right border is green, bottom border is blue and left border is pink border-color:red green blue; top border is red, right and left borders are green and bottom border is blue border-color:red green; top and bottom borders are red, right and left borders are green border-color:red; all four borders are red. You can also try this way: border-left-color, border-top-color, border-right-color and border-bottom-color
11th Feb 2017, 4:57 AM
Nəzər Nəsirzadə
Nəzər Nəsirzadə - avatar
+ 2
thank you
11th Feb 2017, 4:58 AM
Anji Shukla
Anji Shukla - avatar
0
border style?? what is a border style
11th Feb 2017, 4:59 AM
Anji Shukla
Anji Shukla - avatar
0
It is also a property. Example: p {     border-style: solid;     border-color: #ff0000 #0000ff; }
11th Feb 2017, 5:02 AM
Nəzər Nəsirzadə
Nəzər Nəsirzadə - avatar
- 1
for border colour, you need to learn CSS... p{ border: 2px solid green; } or p{ border-style: solid; border-color: green; }
11th Feb 2017, 8:48 AM
Chandan Kumar Y S
Chandan Kumar Y S - avatar