The outline’s color can be changed using the outline-color attribute.
You can set the color by:
Several outlines of various colors are displayed in the sample that follows. Moreover, take note of the thin black border that surrounds the contour of these elements:
A solid red outline.
A dotted blue outline.
An outset grey outline.
p.ex1 {
border: 2px solid black;
outline-style: solid;
outline-color: red;
}
p.ex2 {
border: 2px solid black;
outline-style: dotted;
outline-color: blue;
}
p.ex3 {
border: 2px solid black;
outline-style: outset;
outline-color: grey;
}
Hexadecimal values (HEX) can also be used to specify the outline color:
p.ex1 {
outline-style: solid;
outline-color: #ff0000; /* red */
}
Alternatively, by employing RGB values:
p.ex1 {
outline-style: solid;
outline-color: rgb(255, 0, 0); /* red */
}
Moreover, HSL values can be used:
p.ex1 {
outline-style: solid;
outline-color: hsl(0, 100%, 50%); /* red */
}
CodingAsk.com is designed for learning and practice. Examples may be made simpler to aid understanding. Tutorials, references, and examples are regularly checked for mistakes, but we cannot guarantee complete accuracy. By using CodingAsk.com, you agree to our terms of use, cookie, and privacy policy.
Copyright 2010-2024 by Refsnes Data. All Rights Reserved.