Set border width with CSS

The border-width property allows you to set the width of element borders. The value of this property could be either a length in px, pt or cm or it should be set to thin, medium or thick.

Example

You can try to run the following code to set the border width with CSS:

<html>
   <head>
   </head>
   <body>
      <p style = "border-width:4px; border-style:solid;">
         David Beckham is a legend.
      </p>
      <p style = "border-width:4pt; border-style:dashed;">
         Sachin Tendulkar is a legend.
      </p>
   </body>
</html>
Updated on: 2020-02-03T06:21:34+05:30

419 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements