Categories
Web development

CSS border-left Property

CSS border-left Property

The CSS border-left property is a shorthand property for the following properties:

border-left-width

border-left-style

border-left-color

Syntax:

border-left: border-width border-style border-color;

border-left-width – settles the width of an element’s left border.

border-left-style – settles the style of an element’s left border.

border-left-color – settles the color of an element’s left border.

Example:

<!DOCTYPE html>
<html>
<head>
<style>
h4 {
  border-left: 7px solid #333;
}

p {
  border-left: 5px dotted #e76f51;
}

div {
  border-left: double;
}
</style>
</head>
<body>

<h4>A heading with a solid #333 left border</h4>

<p>A paragraph with a dotted #e76f51 left border</p>

<div>A div element with a double left border.</div>

</body>
</html>

Output:

A heading with a solid #333 left border

A paragraph with a dotted #e76f51 left border

A div element with a double left border.

Enjoy coding!

Read also:

CSS Border Property

CSS border-bottom Property

Categories
Web development

CSS border-left-width Property

CSS border-left-width Property

The CSS border-left-width property settles the width of an element’s left border.

Demo:

Syntax:

border-left-width: medium|thin|thick|length;

medium (default) – defines a medium left border.

thin – defines a thin left border.

thick – defines a thick left border.

length – allows you to specify the thickness of the left border (CSS Units).

Example1:

Set the width of the left border to thin:

<!DOCTYPE html>
<html>
<head>
<style>
h4 {
  border-left-style: solid;
  border-left-width: thin;
}

p {
  border-style: solid;
  border-left-width: thin;
}
</style>
</head>
<body>

<h4>A heading with a thin left border.</h4>
<p>A paragraph with a thin left border.</p>

</body>
</html>

Output:

A heading with a thin left border.

A paragraph with a thin left border.


Example2:

Set the width of the left border to 10px:

<!DOCTYPE html>
<html>
<head>
<style>
h4 {
  border-left-style: solid;
  border-left-width: 10px;
}

p {
  border-style: solid;
  border-left-width: 10px;
}
</style>
</head>
<body>

<h4>A heading with a 10px thick left border.</h4>
<p>A paragraph with a 10px thick left border.</p>

</body>
</html>

Output:

A heading with a 10px thick left border.

A paragraph with a 10px thick left border.


Enjoy coding!

Read also:

CSS border-radius property

CSS border-bottom-width Property

Categories
Web development

CSS border-left-style

CSS border-left-style

The CSS border-left-style property settles the style of an element’s left border.

Demo:

Syntax:

border-left-style: dotted|dashed|solid|double|groove|ridge|inset|outset|none|hidden|;

none (default) – defines no border.

hidden – a border is not visible.

dotted – defines a dotted border.

dashed – defines a dashed border.

solid – defines a solid border.

double – defines a double border.

groove – defines a 3D grooved border.

ridge – defines a 3D ridged border.

inset – defines a 3D inset border.

outset – defines a 3D outset border.

Example1:

A dashed left border:

<!DOCTYPE html>
<html>
<head>
<style>
h4 {
  border-left-style: dashed;
  padding:10px;
}

p {
  border-style: solid;
  border-left-style: dashed;
  padding:10px;
}
</style>
</head>
<body>

<h4>A heading with a dashed left border.</h4>
<p>A paragraph with a dashed left border.</p>

</body>
</html>

Output:

A heading with a dashed left border.

A paragraph with a dashed left border.


Example2:

A dotted left border:

<!DOCTYPE html>
<html>
<head>
<style>
h4 {
  border-left-style: dotted;
  
}

p {
  border-style: solid;
  border-left-style: dotted;
  
}
</style>
</head>
<body>

<h4>A heading with a dotted left border.</h4>
<p>A paragraph with a dotted left border.</p>

</body>
</html>

Output:

A heading with a dotted left border.

A paragraph with a dotted left border.


Enjoy coding!

Read also:

CSS border Property

CSS border-bottom Property

Categories
Web development

CSS border-left-color Property

CSS border-left-color Property

The CSS border-left-color property settles the color of an element’s left border.

Syntax:

border-left-color: color|transparent;

color – defines the color of the left border.

transparent – the border color will be transparent.

Example:

<!DOCTYPE html>
<html>
<head>
<style>
h4 {
  border-left-style: solid;
  border-left-color: #2a9d8f;
}

p {
  border-style: solid;
  border-left-color: #2a9d8f;
}
</style>
</head>
<body>

<h4>A heading with a colored left border.</h4>
<p>A paragraph with a colored left border.</p>

</body>
</html>

Output:

A heading with a colored left border.

A paragraph with a colored left border.


Enjoy coding!

Read also:

CSS border Property

CSS border-bottom Property