CSS Example: Outline-Color
x
<title>My Example</title>
<style>
div {
color: darkorange;
font-size: 3vw;
padding: 3vw;
margin: 3vw;
border: thin solid black;
outline-style: solid;
outline-width: thick;
}
.a {
outline-color: limegreen;
}
.b {
outline: 5px dotted gold;
}
</style>
<div>Default color. If the outline's color hasn't been explicity set, it uses <code>currentColor</code> (the value of the <code>color</code> property).</div>
<div class="a">This box's outline color has been explicity set.</div>
<div class="b">This box has had its outline properties set using the <code>outline</code> shorthand property.</div>
In this example, the left side provides the code used to render the output in the right side.
Feel free to copy and paste the code into your own project and modify as you wish.
About CSS
CSS stands for Cascading Style Sheets. It's used to add styles to web pages. It's typically added to HTML pages using the <link>
tag, so that we can have the CSS in a separate file to the HTML file. However, we also have the option of embedding the CSS in the actual HTML file by using the <style>
HTML tag, or by using the style
attribute within an individual HTML tag.