CSS - border
border
the css property border controls the border of an element, is the shorthand code for:
border-width: the width of the element border
border-style: solid, dashed, dotted.
border-color: color code for the border
Property Variable Name
border
Available Values for border
10px dotted #001122 |initial|inherit
Examples Using border values
Example using border 10px dotted #001122
Example using border 10px dotted #001122
Here is an example using border:10px dotted #001122 ;
Code
<style>
/* Some Styles so we can see the element */
.demo-box-1 {
background:#999;
margin-bottom:10px;
height:220px;
width:100%;
display: flex;
flex-wrap: wrap;
color:#FFF;
align-items: center;
justify-content: center;
}
.demo-box-1 {
/* this is the test property */
border:10px dotted #001122 ;
}
</style>
<h2>Example using border 10px dotted #001122 </h2>
<p>Here is an example using <code>border:10px dotted #001122 ;</code></p>
<div class='demo-box-1'>
</div>
Example using border initial
Example using border initial
Here is an example using border:initial;
Code
<style>
/* Some Styles so we can see the element */
.demo-box-2 {
background:#999;
margin-bottom:10px;
height:220px;
width:100%;
display: flex;
flex-wrap: wrap;
color:#FFF;
align-items: center;
justify-content: center;
}
.demo-box-2 {
/* this is the test property */
border:initial;
}
</style>
<h2>Example using border initial</h2>
<p>Here is an example using <code>border:initial;</code></p>
<div class='demo-box-2'>
</div>
Example using border inherit
Example using border inherit
Here is an example using border:inherit;
Code
<style>
/* Some Styles so we can see the element */
.demo-box-3 {
background:#999;
margin-bottom:10px;
height:220px;
width:100%;
display: flex;
flex-wrap: wrap;
color:#FFF;
align-items: center;
justify-content: center;
}
.demo-box-3 {
/* this is the test property */
border:inherit;
}
</style>
<h2>Example using border inherit</h2>
<p>Here is an example using <code>border:inherit;</code></p>
<div class='demo-box-3'>
</div>