w3resource

CSS border-left-width property

border-left-width property

CSS border-left-width property sets the width of a box's left border.

Syntax:

border-left-width: width | inherit

Values

width: Width of the left border of a box. The following table shows the values :

Value Description
thin A thin border is set if specified
medium A medium border is set if specified.
thick A thick border is set if specified
length You may use em, ex, in(for inches), cm(for centimeters), mm(for millimeters), pt(for points), pc(for picas), px(for pixel).
inherit Specifies that the border width should be inherited from the parent element

inherit : If set, the associated element takes computed value of its parent element's border-left-width property.

Initial value

medium

Applies to

border-left-width property can be applied to all HTML elements which may form a box.

Inherited

No.

Percentages

Not available.

Media

visual.

Computed value

If the value set to none or hidden, it is 0, else it is an absolute value.

Browser compatibility

Browser Version
Internet Explorer 4.0 and above
Firefox (Gecko) 1.0 and above
Opera 3.5 and above
Safari (WebKit) 1.0 and above

Example of border-left-width property

CSS code:

.w3r_thin {
border-left-width: thin;
border-style: solid;
}
.w3r_thick {
border-left-width: thick;
border-style: solid;
}
.w3r_medium {
border-left-width: medium;
border-style: solid;
}
.w3r_px{
border-left-width: 3px;
border-style: solid;
}
.w3r_pc {
border-left-width: 3pc;
border-style: solid;
}
.w3r_pt {
border-left-width: 3pt;
border-style: solid;
}
.w3r_mm {
border-left-width: 5mm;
border-style: solid;
}
.w3r_cm {
border-left-width: 1cm;
border-style: solid;
}
.w3r_in {
border-left-width: 1in;
border-style: solid;
}
.w3r_ex {
border-left-width: 3ex;
border-style: solid;
}
.w3r_em {
border-left-width: 3em;
border-style: solid;
}

HTML code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>CSS border-left-width example - w3resource</title>
<link rel='stylesheet' href='border-left-width.css' type='text/css' />
</head>
<body>
<p  class="w3r_thin">Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p  class="w3r_thick">Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p  class="w3r_medium">Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p  class="w3r_px">Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p  class="w3r_pc">Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p  class="w3r_pt">Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p  class="w3r_mm">Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p  class="w3r_in">Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p  class="w3r_cm">Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p  class="w3r_em">Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p  class="w3r_ex">Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</body>
</html>

View this example in a separate browser window

Example of border-left-width property.

Previous: CSS border-bottom-width property
Next: CSS Font Families



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/css/border/CSS-border-left-width-property.php