Defining the Border Width

Description

You may express the border-width property as

  • a regular CSS length: em, px, or cm
  • a percentage of the width of the area that the border will be drawn around: perc%
  • one of three shortcut values: thin, medium, thick

The default border-width value is medium.

Example

The following code defines a Basic Border.


<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
p {<!--from   w  w  w  .  ja v  a 2  s  .  c  om-->
  border-width: 5px;
  border-style: solid;
  border-color: black;
}
</style>
</head>
<body>
  <p>This is a test.</p>
</body>
</html>

Click to view the demo





















Home »
  HTML CSS »
    CSS »




CSS Introduction
CSS Background
CSS Border
CSS Box Layout
CSS Text
CSS Font
CSS Form
CSS List
CSS Selectors
CSS Others
CSS Table