I\'m trying to add a border to a div element in HTML. Below is my code.
The default value of border-style is none
. You need to set a different value for a border to appear.
#container-border {
border-width: 2px;
border-color: red;
border-style: dashed;
}
<div id="container-border">
...
</div>
You have to set the rule "border-style" to see the border
#container-border {
border-width: 2px;
border-color: red;
border-style:solid;
}
<div id="container-border">
...
</div>
You can use the shortcode for border, which contains color, width AND style (which you are missing right now):
#container-border {
border: 2px solid red;
}