Categories
Web development

CSS border-right-width Property

CSS border-right-width Property

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

Demo:

Syntax:

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

medium (default) – defines a medium right border.

thin – defines a thin right border.

thick – defines a thick right border.

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

Example1:

Set the width of the right border to thin:

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

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

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

</body>
</html>

Output:

A heading with a thin right border.

A paragraph with a thin right border.


Example2:

Set the width of the left border to 10px:

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

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

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

</body>
</html>

Output:

A heading with a 10px thick right border.

A paragraph with a 10px thick right border.


Enjoy coding!

Read also:

CSS border-bottom-width Property

CSS border-left-width Property

Categories
Web development

CSS border-right-style Property

CSS border-right-style Property

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

Demo:

Syntax:

border-right-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-right-style: dashed;
  padding:10px;
}

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

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

</body>
</html>

Output:

A heading with a dashed right border.

A paragraph with a dashed right border.


Example2:

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

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

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

</body>
</html>

Output:

A heading with a dotted right border.

A paragraph with a dotted right border.


Enjoy coding!

Read also:

CSS border Property

CSS border-left-style

Categories
Web development

CSS border-right-color Property

CSS border-right-color Property

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

Syntax:

border-right-color: color|transparent;

color – defines the color of the right border.

transparent – the border color will be transparent.

Example:

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

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

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

</body>
</html>

Output:

A heading with a colored right border.

A paragraph with a colored right border.


Enjoy coding!

Read also:

CSS border Property

CSS border-left-color Property

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

Categories
Web development

CSS border-image Property

CSS border-image Property

By using the CSS border-image property you can define an image to be used as the border around an element.

The CSS border-image property is a shorthand property for:

border-image-source

border-image-slice

border-image-width

border-image-outset

border-image-repeat

Syntax:

border-image: source slice width outset repeat;

border-image-source – defines the path to the image to be used as a border.

border-image-slice – defines how to slice the image defined by the CSS border-image-source.

border-image-width – defines the width of the border-image.

border-image-outset – defines the amount by which the border-image area extends beyond the border-box.

border-image-repeat – defines whether the border-image should be repeated, rounded or stretched.

Example:

<!DOCTYPE html>
<html>
<head>
<style> 
#borderimg-1 { 
  border: 10px solid transparent;
  padding: 15px;
  border-image: url(https://lenadesign.org/wp-content/uploads/2021/09/border-1.png) 30 round;
}

#borderimg-2 { 
  border: 10px solid transparent;
  padding: 15px;
  border-image: url(https://lenadesign.org/wp-content/uploads/2021/09/border-1.png) 60 stretch;
}
</style>
</head>
<body>

<p id="borderimg-1">The image tiles to fill the area. The image is re-scaled if necessary, to avoid dividing tiles.</p>
<p id="borderimg-2">The image is stretched to fill the area.</p>

</body>
</html>

Output:

The image tiles to fill the area. The image is re-scaled if necessary, to avoid dividing tiles.

The image is stretched to fill the area.


The original image:

Enjoy coding!

Read also:

CSS Border Property

CSS Glowing Gradient Border

Categories
Web development

CSS border-image-width Property

CSS border-image-width Property

The CSS border-image-width property defines the width of the border-image.

Demo:

Click the “Try it” button to change the value of the border-image-width property 10px to 20px 30px:



Hello World!


Syntax:

border-image-width: length|number|%|auto;

length – a length unit (in px) defining the size of the border-width.

number – represents multiples of the corresponding border-width (the default value is 1).

% – refers to the size of the border image area: the width of the area for horizontal offsets, the height for vertical offsets.

auto – if defined, the width is the intrinsic width or height of the corresponding image slice.

Example:

<!DOCTYPE html>
<html>
<head>
<style> 
#borderimg-1 { 
  border: 10px solid transparent;
  padding: 15px;
  border-image-source: url(https://lenadesign.org/wp-content/uploads/2021/09/border-1.png);
  border-image-repeat: round;
  border-image-slice: 30;
  border-image-width: 10px;    
}

#borderimg-2 { 
  border: 10px solid transparent;
  padding: 15px;
  border-image-source: url(https://lenadesign.org/wp-content/uploads/2021/09/border-1.png);
  border-image-repeat: round;
  border-image-slice: 30;
  border-image-width: 15px;    
}

#borderimg-3 { 
  border: 10px solid transparent;
  padding: 15px;
  border-image-source: url(https://lenadesign.org/wp-content/uploads/2021/09/border-1.png);
  border-image-repeat: round;  
  border-image-slice: 30;
  border-image-width: 20px;    
}
</style>
</head>
<body>

<p id="borderimg-1">border-image-width: 10px;</p>
<p id="borderimg-2">border-image-width: 15px;</p>
<p id="borderimg-3">border-image-width: 20px;</p>

</body>
</html>

Output:

border-image-width: 10px;

border-image-width: 15px;

border-image-width: 20px;


The original image:

CSS border-image Property

Enjoy coding!

Read also:

CSS Border Property

Advanced CSS Border-radius/ Drop Shape, Lemon Shape, Leaf Shape & Egg Shape

Categories
Web development

CSS border-image-slice Property

CSS border-image-slice Property

The CSS border-image-slice property defines how to slice the image defined by the CSS border-image-source (the image is sliced into nine sections: four corners, four edges and the middle).

Demo:

Click the “Try it” button to change the value of the border-image-slice property to 30%:



Hello World!


Syntax:

border-image-slice: number|%|fill;

number – the number(s) represent pixels for raster images or coordinates for vector images.

% – percentages are relative to the height or width of the image.

fill – causes the middle part of the image to be displayed.

Example:

<!DOCTYPE html>
<html>
<head>
<style>
#borderimg-1 {
  border: 10px solid transparent;
  padding: 15px;
  border-image: url(https://lenadesign.org/wp-content/uploads/2021/09/border-1.png) round;
  border-image-slice: 10%;
}

#borderimg-2 {
  border: 10px solid transparent;
  padding: 15px;
  border-image: url(https://lenadesign.org/wp-content/uploads/2021/09/border-1.png) round;
  border-image-slice: 20%;
}

#borderimg-3 {
  border: 10px solid transparent;
  padding: 15px;
  border-image: url(https://lenadesign.org/wp-content/uploads/2021/09/border-1.png) round;
  border-image-slice: 30%;
}
</style>
</head>
<body>

<p id="borderimg-1">border-image-slice: 10%;</p>
<p id="borderimg-2">border-image-slice: 20%;</p>
<p id="borderimg-3">border-image-slice: 30%;</p>

</body>
</html>

Output:

border-image-slice: 10%;

border-image-slice: 20%;

border-image-slice: 30%;


The original image:

CSS border-image Property

Enjoy coding!

Read more:

CSS Gradient Border

CSS Glowing Gradient Border