Set border style in four directions differently and separately in HTML and CSS

Description

The following code shows how to set border style in four directions differently and separately.

Example


<!--   w ww.  j a  v  a 2  s  . co  m-->
<html>
<head>
<style type='text/css'>
body {
font: 12px sans-serif;
}
div#border-style-properties {
border-top-style: solid;
border-right-style: dashed;
border-bottom-style: double;
border-left-style: inset;
}

</style>
</head>
<body>
<div id='border-style-properties'>
Peter Piper picked a peck of pickled peppers.
Did Peter Piper pick a peck of pickled peppers?
If Peter Piper picked a peck of pickled peppers,
where's the peck of pickled peppers Peter Piper picked?
</div>

</body>
</html>

Click to view the demo

The code above generates the following result.

Set border style in four directions differently and separately in HTML and CSS
Home »
  HTML CSS Tutorial »
    Layout »
      Border
...
Overwrite border in HTML and CSS
Set Border width differently for four direc...
Set Border width for different directions i...
Set Border width in four differently values...
Set Border width in one value in HTML and C...
Set Border width in three values in HTML an...
Set Border width in two values in HTML and ...
Set border - 1px solid crimson in HTML and ...
Set border-bottom - 1px dotted black in HTM...
Set border bottom style to dashed in HTML a...
Set border-bottom-style to double in HTML a...
Set border-bottom-width to 2px in HTML and ...
Set border color for different directions i...
Set border-color to blue in HTML and CSS
Set border color to red in HTML and CSS
Set border-left-style to inset in HTML and ...
Set border-left to 1px solid crimson; in HT...
Set border-right-style to dashed in HTML an...
Set border style in four directions differe...
Set border-style in four directions - solid...
Set border-style in three directions - soli...
Set border-style to dashed in HTML and CSS
Set border-style to dotted in HTML and CSS
Set border-style to groove in HTML and CSS
Set border style to hidden in HTML and CSS
Set border-style to inset in HTML and CSS
Set border-style to none in HTML and CSS
Set border-style to outset in HTML and CSS
Set border-style to ridge in HTML and CSS
Set border-style to solid in HTML and CSS
Set border style with shorthand three value...
Set border style with shorthand two values ...
Set border - thin solid rgb(0, 0, 0) in HTM...
Set border to use em measurement - 1em soli...
Set border top color to black in HTML and C...
Set border-top-style to solid in HTML and C...
Set border-top to 4px groove blue in HTML a...
Set border-top to 6px ridge green in HTML a...
...