
HTML Element āĻā§āϞā§āϰ āĻŦāϰā§āĻĄāĻžāϰā§āϰ āϏā§āĻāĻžāĻāϞ, āĻāĻžāϞāĻžāϰ āĻāĻŦāĻ āĻĒā§āϰāϏā§āĻĨ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰāĻžāϰ āĻāύā§āϝ CSS border āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻā§āϞ⧠āĻŦā§āϝāĻŦāĻšā§āϤ āĻšāϝāĻŧāĨ¤ āύāĻŋāĻŽā§āύ⧠Border Property āĻā§āϞā§āϰ āύāĻžāĻŽ āĻĻā§āĻāϝāĻŧāĻž āĻšāϞ⧠:
- border
- border-width
- border-style
- border-color
- border-top
- border-top-width
- border-top-style
- border-top-color
- border-right
- border-right-width
- border-right-style
- border-right-color
- border-left
- border-left-width
- border-left-style
- border-left-color
- border-bottom
- border-bottom-width
- border-bottom-style
- border-bottom-color
- border-radius
- border-image
- border-image-source
- border-image-slice
- border-image-width
- border-image-outset
- border-image-repeat
border-style
āĻŦāϰā§āĻĄāĻžāϰā§āϰ āϏā§āĻāĻžāĻāϞ āϏā§āĻ āĻāϰāĻžāϰ āĻāύā§āϝ āĻāĻāĻŋ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāĻž āĻšāϝāĻŧāĨ¤ āĻāϰ⧠āĻāĻžāϞā§āĻāĻžāĻŦā§ āĻŦāϞāĻž āϝāĻžāϝāĻŧ āĻŦāĻŋāĻāĻŋāύā§āύ āϧāϰāύā§āϰ āĻŦāϰā§āĻĄāĻžāϰ āϤā§āϰāĻŋāϰ āĻāύā§āϝ āϏāĻŋāĻāϏāĻāϏ border-style āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĻāĻŋ āĻŦā§āϝāĻŦāĻšā§āϤ āĻšāϝāĻŧāĨ¤ āĻāϰ border-style āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϤ⧠āĻāĻ āĻĨā§āĻā§ āĻāĻžāϰāĻāĻŋ āĻĒāϰā§āϝāύā§āϤ value āĻĨāĻžāĻāϤ⧠āĻĒāĻžāϰā§āĨ¤ āĻāĻāĻŋ āĻā§āϰāĻŽāĻžāύā§āϏāĻžāϰ⧠āĻāĻĒāϰā§āϰ Border āĻĨā§āĻā§ āĻļā§āϰ⧠āĻāϰ⧠āĻĄāĻžāύāĻĒāĻžāĻļā§, āύāĻŋāĻā§ āĻāĻŦāĻ āĻŦāĻžāĻŽāĻĒāĻžāĻļā§ āĻāĻŋāϝāĻŧā§ āĻļā§āώ āĻšāϝāĻŧāĨ¤
āύāĻŋāĻŽā§āύ⧠border-style āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻāύā§āϝ āĻŦā§āϝāĻŦāĻšā§āϤ āĻā§āϝāĻžāϞā§āĻā§āϞ⧠āĻĻā§āĻāϝāĻŧāĻž āĻšāϞā§āĻ
- solid â āĻāĻāĻŋ solid Border āϤā§āϰ⧠āĻāϰā§
- double â āĻāĻāĻŋ double Border āϤā§āϰ⧠āĻāϰā§
- dotted â āĻāĻāĻŋ dotted Border āϤā§āϰ⧠āĻāϰā§
- dashed â āĻāĻāĻŋ dashed Border āϤā§āϰ⧠āĻāϰā§
- inset â āĻāĻāĻŋ 3D inset Border āϤā§āϰ⧠āĻāϰā§āĨ¤ āϝā§āĻāĻž border-color āĻāϰ āĻā§āϝāĻžāϞā§āϰ āĻāĻĒāϰ āύāĻŋāϰā§āĻāϰ āĻāϰā§
- outset â āĻāĻāĻŋ 3D outset Border āϤā§āϰ⧠āĻāϰā§āĨ¤ āϝā§āĻāĻž border-color āĻāϰ āĻā§āϝāĻžāϞā§āϰ āĻāĻĒāϰ āύāĻŋāϰā§āĻāϰ āĻāϰā§
- groove â āĻāĻāĻŋ 3D grooved Border āϤā§āϰ⧠āĻāϰā§āĨ¤ āϝā§āĻāĻž border-color āĻāϰ āĻā§āϝāĻžāϞā§āϰ āĻāĻĒāϰ āύāĻŋāϰā§āĻāϰ āĻāϰā§
- ridge â āĻāĻāĻŋ 3D ridge Border āϤā§āϰ⧠āĻāϰā§āĨ¤ āϝā§āĻāĻž border-color āĻāϰ āĻā§āϝāĻžāϞā§āϰ āĻāĻĒāϰ āύāĻŋāϰā§āĻāϰ āĻāϰā§
- hidden â āĻāĻāĻŋ Border Hidden āĻāϰā§
- none â āĻā§āύ Border āϤā§āϰ⧠āĻāϰ⧠āύāĻž
āĻāĻŦāĻžāϰ āĻāϞā§āύ āϏāĻŦ āĻā§āϞā§āĻā§ āĻāĻāĻāĻž āĻāĻĻāĻžāĻšāϰāĻŖā§āϰ āĻŽāϧā§āϝ⧠āĻĻā§āĻā§ āύā§āϝāĻŧāĻž āϝāĻžāĻ :
<!DOCTYPE html>
<html>
<head>
<style>
p.dotted {border-style: dotted;}
p.dashed {border-style: dashed;}
p.solid {border-style: solid;}
p.double {border-style: double;}
p.groove {border-style: groove;}
p.ridge {border-style: ridge;}
p.inset {border-style: inset;}
p.outset {border-style: outset;}
p.none {border-style: none;}
p.hidden {border-style: hidden;}
p.mix {border-style: dotted dashed solid double;}
</style>
</head>
<body>
<h2>The border-style Property</h2>
<p>This property specifies what kind of border to display:</p>
<p class="dotted">A dotted border.</p>
<p class="dashed">A dashed border.</p>
<p class="solid">A solid border.</p>
<p class="double">A double border.</p>
<p class="groove">A groove border.</p>
<p class="ridge">A ridge border.</p>
<p class="inset">An inset border.</p>
<p class="outset">An outset border.</p>
<p class="none">No border.</p>
<p class="hidden">A hidden border.</p>
<p class="mix">A mixed border.</p>
</body>
</html>
Output

āĻŦāĻŋāĻāĻĻā§āϰāĻ border-style āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞ⧠āϏā§āĻ āĻāϰāĻž āύāĻž āĻšāϞ⧠āĻŦāϰā§āĻĄāĻžāϰ āϏāĻāĻā§āϰāĻžāύā§āϤ āĻ āύā§āϝāĻžāύā§āϝ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĻā§āϞ⧠āĻāĻžāĻ āĻāϰāĻŦā§ āύāĻžāĨ¤
border-width
āϝ⧠āĻā§āύ⧠html Element āĻāϰ āĻāĻžāϰāĻŋāĻĻāĻŋāĻā§āϰ āĻŦāϰā§āĻĄāĻžāϰā§āϰ width āϏā§āĻ āĻāϰāĻžāϰ āĻāύā§āϝ CSS border-width āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĻāĻŋ āĻŦā§āϝāĻŦāĻšā§āϤ āĻšāϝāĻŧāĨ¤
CSS āĻ width āĻāĻŦāĻ height āύāĻŋāϰā§āϧāĻžāϰāĻŖā§āϰ āĻŦāĻŋāĻāĻŋāύā§āύ āĻāĻāĻ āϝā§āĻŽāύāĻ px, pt, cm, em āĻāϤā§āϝāĻžāĻĻāĻŋ āĻŦā§āϝāĻŦāĻšā§āϤ āĻšāϝāĻŧāĨ¤ āĻāĻāĻāĻāĻžāĻŦā§ āĻāĻĒāύāĻŋ āĻŦāϰā§āĻĄāĻžāϰā§āϰ width āϏā§āĻ āĻāϰāϤā§āĻ āĻāĻā§āϞ⧠āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāϤ⧠āĻĒāĻžāϰā§āύāĨ¤ āĻ āĻĨāĻŦāĻž āĻĒā§āϰā§āĻŦ āύāĻŋāϰā§āϧāĻžāϰāĻŋāϤ āĻā§āϝāĻžāϞ⧠āϝā§āĻŽāύ thin, medium āĻāĻŦāĻ thick āĻāϤā§āϝāĻžāĻĻāĻŋ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰā§āĻ āĻŦāϰā§āĻĄāĻžāϰā§āϰ width āϏā§āĻ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŦā§āύāĨ¤
border-width āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻāĻ āĻšāϤ⧠āϏāϰā§āĻŦā§āĻā§āĻ āĻāĻžāϰāĻāĻŋ āĻā§āϝāĻžāϞ⧠āĻĨāĻžāĻāϤ⧠āĻĒāĻžāϰā§āĨ¤ āĻāĻā§āϞ⧠āĻšāϞā§āĻ top border, right border, bottom border āĻāĻŦāĻ left border
<!DOCTYPE html>
<html>
<head>
<style>
p.one {
border-style: solid;
border-width: 5px;
}
p.two {
border-style: solid;
border-width: medium;
}
p.three {
border-style: dotted;
border-width: 2px;
}
p.four {
border-style: dotted;
border-width: thick;
}
p.five {
border-style: double;
border-width: 15px;
}
p.six {
border-style: double;
border-width: thick;
}
p.seven {
border-style: solid;
border-width: 2px 10px 4px 20px;
}
</style>
</head>
<body>
<h2>The border-width Property</h2>
<p>This property specifies the width of the four borders:</p>
<p class="one">Some text.</p>
<p class="two">Some text.</p>
<p class="three">Some text.</p>
<p class="four">Some text.</p>
<p class="five">Some text.</p>
<p class="six">Some text.</p>
<p class="seven">Some text.</p>
</body>
</html>
Output

āĻŦāĻŋāĻāĻĻā§āϰāĻ border-style āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞ⧠āϏā§āĻ āĻāϰāĻž āύāĻž āĻšāϞ⧠āĻŦāϰā§āĻĄāĻžāϰ āϏāĻāĻā§āϰāĻžāύā§āϤ āĻ āύā§āϝāĻžāύā§āϝ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĻā§āϞ⧠āĻāĻžāĻ āĻāϰāĻŦā§ āύāĻžāĨ¤
border-color
HTML Element āĻā§āϞā§āϰ Border Color āϏā§āĻ āĻāϰāĻžāϰ āĻāύā§āϝ border-color āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĻāĻŋ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāĻž āĻšāϝāĻŧāĨ¤
āύāĻŋāĻā§āϰ āϝā§āĻā§āύ⧠āĻāĻāĻāĻŋ āĻĒāĻĻā§āϧāϤāĻŋ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āĻāĻžāϞāĻžāϰ āϏā§āĻ āĻāϰāĻž āϝāĻžāϝāĻŧāĻ
- Name â āĻāĻžāϞāĻžāϰā§āϰ āύāĻžāĻŽ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰā§, āϝā§āĻŽāύ âredâ
- Hex â āĻšā§āĻā§āϏāĻžāĻĄā§āϏāĻŋāĻŽāĻžāϞ āĻā§āϝāĻžāϞ⧠āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰā§, āϝā§āĻŽāύ â#ff0000â
- RGB â RGB āĻā§āϝāĻžāϞ⧠āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰā§, āϝā§āĻŽāύ ârgb(255,0,0)â āĻ āĻĨāĻŦāĻž
- transparent āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰā§āĨ¤
border-color āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻāĻ āĻšāϤ⧠āϏāϰā§āĻŦā§āĻā§āĻ āĻāĻžāϰāĻāĻŋ āĻā§āϝāĻžāϞ⧠āĻĨāĻžāĻāϤ⧠āĻĒāĻžāϰā§āĨ¤ āĻāĻā§āϞ⧠āĻšāϞā§: (top border, right border, bottom border, āĻāĻŦāĻ left border)
border-color āύāĻŋāϰā§āϧāĻžāϰāĻŖ āĻāϰāĻž āύāĻž āĻšāϞ⧠āĻāĻšāĻž āĻāϤā§āϤāϰāĻžāϧāĻŋāĻāĻžāϰ āϏā§āϤā§āϰ⧠āĻāϞāĻŋāĻŽā§āύā§āĻāĻā§ āĻāĻžāϞāĻžāϰ āĻāϰ⧠āĻĢā§āϞā§āĨ¤
āύāĻŋāĻā§āϰ āĻāĻĻāĻžāĻšāϰāĻŖā§ border-color āĻāϰ āϏāĻŦāĻā§āϞ⧠āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻĻā§āĻāĻžāύ⧠āĻšāϝāĻŧā§āĻā§ :
<!DOCTYPE html>
<html>
<head>
<style>
p.one {
border-style: solid;
border-color: red;
}
p.two {
border-style: solid;
border-color: green;
}
p.three {
border-style: solid;
border-color: red green blue yellow;
}
</style>
</head>
<body>
<h2>The border-color Property</h2>
<p>This property specifies the color of the four borders:</p>
<p class="one">A solid red border</p>
<p class="two">A solid green border</p>
<p class="three">A solid multicolor border</p>
</body>
</html>
Output

āĻŦāĻŋāĻāĻĻā§āϰāĻ border-style āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞ⧠āϏā§āĻ āĻāϰāĻž āύāĻž āĻšāϞ⧠āĻŦāϰā§āĻĄāĻžāϰ āϏāĻāĻā§āϰāĻžāύā§āϤ āĻ āύā§āϝāĻžāύā§āϝ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĻā§āϞ⧠āĻāĻžāĻ āĻāϰāĻŦā§ āύāĻžāĨ¤
āĻĒā§āϰāϤā§āϝā§āĻ āĻĒāĻžāĻļā§ āĻĒā§āĻĨāĻāĻāĻžāĻŦā§ āĻŦāϰā§āĻĄāĻžāϰā§āϰ āĻŦā§āϝāĻŦāĻšāĻžāϰ
āϤāĻŦā§ āĻāĻĒāύāĻŋ āĻāĻžāĻāϞ⧠āĻĒā§āϰāϤā§āϝā§āĻ āĻĒāĻžāĻļā§ āĻāϞāĻžāĻĻāĻž āĻŦāϰā§āĻĄāĻžāϰ āĻĻā§āĻāϝāĻŧāĻžāϰ āĻāύā§āϝ āύāĻŋāĻŽā§āύā§āϰ CSS Property āĻā§āϞ⧠āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāϤ⧠āĻĒāĻžāϰā§āύāĨ¤ āύāĻŋāĻŽā§āύ⧠property āĻā§āϞā§āϰ āύāĻžāĻŽ āĻĻā§āĻāϝāĻŧāĻž āĻšāϞ⧠:
- border-top-style
- border-right-style
- border-bottom-style
- border-left-style
āĻāĻŦāĻžāϰ āĻāϞā§āύ āĻāĻāĻāĻž āĻāĻĻāĻžāĻšāϰāĻŖā§āϰ āĻŽāĻžāϧā§āϝāĻŽā§ āĻĻā§āĻāĻž āϝāĻžāĻ:
<!DOCTYPE html>
<html>
<head>
<style>
p {
border-top-style: dotted;
border-right-style: solid;
border-bottom-style: dotted;
border-left-style: solid;
}
</style>
</head>
<body>
<p>2 different border styles.</p>
</body>
</html>
Output

āϝāĻĻāĻŋāĻ āĻāĻāĻžāĻŦā§ āĻāϞāĻžāĻĻāĻž āĻāϰ⧠property āĻĄāĻŋāĻā§āϞā§āϝāĻŧāĻžāϰ āύāĻž āĻāϰ⧠āĻ āĻŋāĻ āύāĻŋāĻā§āϰ āĻŽāϤ⧠āĻāϰā§āĻ āĻāĻžāĻāĻāĻŋ āĻāϰāϤ⧠āĻĒāĻžāϰā§āύāĨ¤
<!DOCTYPE html>
<html>
<head>
<style>
p {
border-style: dotted solid;
}
</style>
</head>
<body>
<p>2 different border styles.</p>
</body>
</html>
āĻāĻŦāĻžāϰ āĻāϞā§āύ āĻāĻĒāϰā§āϰ āĻāĻĻāĻžāĻšāϰāύāĻāĻŋ āĻāĻŋāĻāĻžāĻŦā§ āĻāĻžāĻ āĻāϰāϞ āύāĻŋāĻā§ āϤāĻž āĻāĻĻāĻžāĻšāϰāĻŖāϏāĻš āĻŦā§āϝāĻžāĻā§āϝāĻž āĻāϰāĻž āϝāĻžāĻāĻ
āϝāĻĻāĻŋ border-style āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϤ⧠āĻāĻžāϰāĻāĻŋ āĻā§āϝāĻžāϞ⧠āĻĨāĻžāĻā§āĻ
āϝā§āĻŽāύ- border-style: dotted solid double dashed;
- āĻāĻĒāϰā§āϰ āĻŦāϰā§āĻĄāĻžāϰāĻāĻŋ dot āϏā§āĻāĻžāĻāϞā§āϰ āĻšāĻŦā§āĨ¤
- āĻĄāĻžāύā§āϰ āĻŦāϰā§āĻĄāĻžāϰāĻāĻŋ solid āϏā§āĻāĻžāĻāϞā§āϰ āĻšāĻŦā§āĨ¤
- āύāĻŋāĻā§āϰ āĻŦāϰā§āĻĄāĻžāϰāĻāĻŋ double āϏā§āĻāĻžāĻāϞā§āϰ āĻšāĻŦā§āĨ¤
- āĻŦāĻžāĻŽā§āϰ āĻŦāϰā§āĻĄāĻžāϰāĻāĻŋ dashed āϏā§āĻāĻžāĻāϞā§āϰ āĻšāĻŦā§āĨ¤
āϝāĻĻāĻŋ border-style āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϤ⧠āϤāĻŋāύāĻāĻŋ āĻā§āϝāĻžāϞ⧠āĻĨāĻžāĻā§āĻ
āϝā§āĻŽāύ- border-style: dotted solid double;
- āĻāĻĒāϰā§āϰ āĻŦāϰā§āĻĄāĻžāϰāĻāĻŋ dot āϏā§āĻāĻžāĻāϞā§āϰ āĻšāĻŦā§āĨ¤
- āĻĄāĻžāύā§āϰ āĻāĻŦāĻ āĻŦāĻžāĻŽā§āϰ āĻŦāϰā§āĻĄāĻžāϰ āĻĻā§āĻāĻŋ solid āϏā§āĻāĻžāĻāϞā§āϰ āĻšāĻŦā§āĨ¤
- āύāĻŋāĻā§āϰ āĻŦāϰā§āĻĄāĻžāϰāĻāĻŋ double āϏā§āĻāĻžāĻāϞā§āϰ āĻšāĻŦā§āĨ¤
āϝāĻĻāĻŋ border-style āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϤ⧠āĻĻā§āĻāĻāĻŋ āĻā§āϝāĻžāϞ⧠āĻĨāĻžāĻā§āĻ
āϝā§āĻŽāύ- border-style: dotted solid;
- āĻāĻĒāϰā§āϰ āĻāĻŦāĻ āύāĻŋāĻā§āϰ āĻŦāϰā§āĻĄāĻžāϰ āĻĻā§āĻāĻŋ dotted āϏā§āĻāĻžāĻāϞā§āϰ āĻšāĻŦā§āĨ¤
- āĻĄāĻžāύā§āϰ āĻāĻŦāĻ āĻŦāĻžāĻŽā§āϰ āĻŦāϰā§āĻĄāĻžāϰ āĻĻā§āĻāĻŋ solid āϏā§āĻāĻžāĻāϞā§āϰ āĻšāĻŦā§āĨ¤
āϝāĻĻāĻŋ border-style āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϤ⧠āĻāĻāĻāĻŋ āĻā§āϝāĻžāϞ⧠āĻĨāĻžāĻā§āĻ
āϝā§āĻŽāύ- âstyle: dotted;
- āĻāĻžāϰāĻĒāĻžāĻļā§āϰ āĻŦāϰā§āĻĄāĻžāϰāĻ dot āϏā§āĻāĻžāĻāϞā§āϰ āĻšāĻŦā§āĨ¤
āĻāĻĒāϰā§āϰ āĻāĻĻāĻžāĻšāϰāĻŖā§ border-style āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻŦā§āϝāĻžāĻŦāĻšāĻžāϰ āĻĻā§āĻāĻžāύ⧠āĻšāϝāĻŧā§āĻā§āĨ¤ āϝāĻžāĻāĻšā§āĻ, border-style āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻŽāϤā§āĻ border-width āĻāĻŦāĻ border-color āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āώā§āϤā§āϰā§āĻ āĻāĻāĻ āύāĻŋāϝāĻŧāĻŽ āĻĒā§āϰāϝā§āĻā§āϝāĨ¤
Border â Shorthand Property
āĻāĻĒāύāĻŋ āĻāĻĒāϰā§āϰ āĻāĻĻāĻžāĻšāϰāĻŖ āĻā§āϞ⧠āϞāĻā§āώā§āϝ āĻāϰāϞ⧠āĻĻā§āĻāĻŦā§āύ āϝā§, Border āĻāϰ āĻāĻŋāĻā§ sub border Property āϰāϝāĻŧā§āĻā§ āĻāĻŦāĻ āĻāϏāĻāϞ āĻā§āώā§āϤā§āϰ⧠āĻā§āĻĄā§āϰ size āĻŦā§āĻĄāĻŧā§ āĻāĻŋāϝāĻŧā§āĻā§āĨ¤
āϤāĻžāĻ āĻā§āĻĄ āϏāĻāĻā§āώāĻŋāĻĒā§āϤ āĻāϰāĻžāϰ āĻāύā§āϝ, āĻāĻāĻāĻŋ Border Property āĻāϰ āĻŽāϧā§āϝ⧠āϏāĻŦāĻā§āϞ⧠Border Property āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāĻž āϝāĻžāϝāĻŧāĨ¤</āĻĒāĻŋ>
āύāĻŋāĻā§āϰ sub border Property āϏāĻŽā§āĻšā§āϰ Shorthand Property āĻšāϞ⧠border:
- border-width
- border-style (āĻāĻŦāĻļā§āϝāĻ)
- border-color
āϤ⧠āĻāϞā§āύ āĻāĻāĻāĻž āĻāĻĻāĻžāĻšāϰāĻŖ āĻĻāĻŋāϝāĻŧā§ āĻŦā§āĻā§ āύā§āϝāĻŧāĻž āϝāĻžāĻ:
<!DOCTYPE html>
<html>
<head>
<style>
p.main {
border: 5px solid red;
}
p.top {
border-top: 6px solid red;
background-color: lightyellow;
}
p.left {
border-left: 6px solid red;
background-color: lightgrey;
}
p.bottom {
border-bottom: 6px solid red;
background-color: lightgreen;
}
p.right {
border-right: 6px solid red;
background-color: lightgreen;
}
</style>
</head>
<body>
<h2>The border Property</h2>
<p class="main">This property is a shorthand property for border-width, border-style, and border-color.</p>
<p class="top">This property is a shorthand property for border-top-width, border-top-style, and border-top-color.</p>
<p class="left">This property is a shorthand property for border-left-width, border-left-style, and border-left-color.</p>
<p class="right">This property is a shorthand property for border-right-width, border-right-style, and border-right-color.</p>
<p class="bottom">This property is a shorthand property for border-bottom-width, border-bottom-style, and border-bottom-color.</p>
</body>
</html>
Output

Rounded Borders (border-radius property)
āϝā§āĻā§āύ⧠html Element āĻāϰ āĻāϤā§āϰā§āĻĻāĻŋāĻā§āϰ Border āĻā§ round āĻāϰāĻžāϰ āĻāύā§āϝ border-radius āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĻāĻŋ āĻŦā§āϝāĻžāĻŦāĻšāĻžāϰ āĻāϰāĻž āĻšāϝāĻŧāĨ¤
āϤ⧠āĻāϞā§āύ āĻāĻāĻāĻž āĻāĻĻāĻžāĻšāϰāĻŖ āĻĻāĻŋāϝāĻŧā§ āĻŦā§āĻā§ āύā§āϝāĻŧāĻž āϝāĻžāĻ:
<!DOCTYPE html>
<html>
<head>
<style>
p.normal {
border: 2px solid red;
}
p.round1 {
border: 2px solid red;
border-radius: 5px;
}
p.round2 {
border: 2px solid red;
border-radius: 8px;
}
p.round3 {
border: 2px solid red;
border-radius: 12px;
}
</style>
</head>
<body>
<h2>The border-radius Property</h2>
<p>This property is used to add rounded borders to an element:</p>
<p class="normal">Normal border</p>
<p class="round1">Round border</p>
<p class="round2">Rounder border</p>
<p class="round3">Roundest border</p>
<p><b>Note:</b> The "border-radius" property is not supported in IE8 and earlier versions.</p>
</body>
</html>
Output

border-radius āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ
- āϏāĻžāϧāĻžāϰāύ āĻŦāϰā§āĻĄāĻžāϰ(Normal border)
- āĻā§āϞ āĻŦāϰā§āĻĄāĻžāϰ (Round border)
- āĻā§āϞāĻžāĻāĻžāϰ āĻŦāϰā§āĻĄāĻžāϰ(Rounder border)
- Roundest border(āĻā§āϞāĻžāĻā§āϤāĻŋ āĻŦāϰā§āĻĄāĻžāϰ)
CSS Rounded Corners
border-radius āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻŽāĻžāϧā§āϝāĻŽā§ āĻāĻĒāύāĻŋ āϝā§āĻā§āύ⧠HTML Element āĻā§ āĻ āĻĨāĻŦāĻž Text āĻā§ āĻā§āĻŦ āϏāĻšāĻā§āĻ āĻŦā§āϤā§āϤāĻžāĻāĻžāϰ āĻŦāϰā§āĻĄāĻžāϰ āĻŦāĻž āĻāϰā§āĻŖāĻžāϰ āĻĻāĻŋāϤ⧠āĻĒāĻžāϰāĻŦā§āύāĨ¤
CSS border-radius Property
CSS āĻ border-radius Property āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āĻāĻĒāύāĻŋ āϝā§āĻā§āύ⧠HTML Element āĻāϰ āĻāϰā§āĻŖāĻžāϰāĻā§ āĻŦā§āϤā§āϤāĻžāĻāĻžāϰ āĻāϰāϤ⧠āĻĒāĻžāϰā§āύāĨ¤
āύāĻŋāĻā§āϰ āĻāĻĻāĻžāĻšāϰāĻŖā§ āϤāĻž āĻĻā§āĻāĻžāύ⧠āĻšāϞā§āĻ
<!DOCTYPE html>
<html>
<head>
<style>
#rcorners1 {
border-radius: 25px;
background: #73AD21;
padding: 20px;
width: 200px;
height: 150px;
}
#rcorners2 {
border-radius: 25px;
border: 2px solid #73AD21;
padding: 20px;
width: 200px;
height: 150px;
}
#rcorners3 {
border-radius: 25px;
background: url(http://satech360.com/wp-content/uploads/2020/04/bluerose-300x300.jpg);
background-position: left top;
background-repeat: repeat;
padding: 20px;
width: 200px;
height: 150px;
}
</style>
</head>
<body>
<h1>The border-radius Property</h1>
<p>Rounded corners for an element with a specified background color:</p>
<p id="rcorners1">Rounded corners!</p>
<p>Rounded corners for an element with a border:</p>
<p id="rcorners2">Rounded corners!</p>
<p>Rounded corners for an element with a background image:</p>
<p id="rcorners3">Rounded corners!</p>
</body>
</html>
Output
The border-radius Property
Rounded corners for an element with a specified background color:
Rounded corners!
Rounded corners for an element with a border:
Rounded corners!
Rounded corners for an element with a background image:
Rounded corners!
āĻŦāϰā§āĻĄāĻžāϰā§āϰ āĻĒā§āϰāϤāĻŋāĻāĻŋ āĻāϰā§āĻŖāĻžāϰ⧠āĻāύā§āϝ āĻāĻŋāύā§āύ āĻāĻŋāύā§āύ āĻā§āϝāĻžāϞ⧠āĻĒā§āϰāϝāĻŧā§āĻ :
āĻāĻĒāύāĻŋ āϝāĻĻāĻŋ border-radius āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϤ⧠āĻļā§āϧ⧠⧧āĻāĻŋ āĻā§āϝāĻžāϞ⧠āĻāϞā§āϞā§āĻ āĻāϰā§āύ āϤāĻžāĻšāϞ⧠āĻāĻāĻŋ ā§ĒāĻāĻŋ āĻāϰā§āĻŖāĻžāϰā§āϰ āĻāύā§āϝāĻ āĻĒā§āϰāϝā§āĻā§āϝ āĻšāĻŦā§āĨ¤
āϤāĻŦā§, āĻāĻĒāύāĻŋ āĻāĻā§āĻāĻž āĻāϰāϞ⧠āĻĒā§āϰāϤā§āϝā§āĻ āĻāϰā§āĻŖāĻžāϰā§āϰ āĻāύā§āϝāĻ āĻāĻŋāύā§āύ āĻāĻŋāύā§āύ āĻā§āϝāĻžāϞ⧠āύāĻŋāϰā§āϧāĻžāϰāĻŖ āĻāϰāϤ⧠āĻĒāĻžāϰā§āύāĨ¤ āĻāĻā§āώā§āϤā§āϰ⧠āĻāĻĒāύāĻŋ āĻāĻāĻāĻŋ āĻĨā§āĻā§ āĻāĻžāϰāĻāĻŋ āĻĒāϰā§āϝāύā§āϤ āĻā§āϝāĻžāϞ⧠āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāϤ⧠āĻĒāĻžāϰā§āύāĨ¤ border-radius āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϤ⧠āĻā§āϝāĻžāϞ⧠āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻĒāĻĻā§āϧāϤāĻŋ āύāĻŋāĻŽā§āύ⧠āϤā§āϞ⧠āϧāϰāĻž āĻšāϞā§āĻ
- āĻāĻžāϰāĻāĻŋ āĻā§āϝāĻžāϞā§āĻ āĻĒā§āϰāĻĨāĻŽ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāĻĒāϰā§āϰ-āĻŦāĻžāĻŽ āĻāϰā§āĻŖāĻžāϰ, āĻĻā§āĻŦāĻŋāϤā§āϝāĻŧ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāĻĒāϰā§āϰ-āĻĄāĻžāύ āĻāϰā§āĻŖāĻžāϰ, āϤā§āϤā§āϝāĻŧ āĻā§āϝāĻžāϞā§āĻāĻŋ āύāĻŋāĻā§āϰ-āĻĄāĻžāύ āĻāϰā§āĻŖāĻžāϰ āĻāĻŦāĻ āĻāϤā§āϰā§āĻĨ āĻā§āϝāĻžāϞā§āĻāĻŋ āύāĻŋāĻā§āϰ-āĻŦāĻžāĻŽ āĻāϰā§āĻŖāĻžāϰā§āϰ āĻāύā§āϝ āĻĒā§āϰāϝā§āĻā§āϝ āĻšāĻŦā§āĨ¤
- āϤāĻŋāύāĻāĻŋ āĻā§āϝāĻžāϞā§āĻ āĻĒā§āϰāĻĨāĻŽ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāĻĒāϰā§āϰ-āĻŦāĻžāĻŽ āĻāϰā§āĻŖāĻžāϰ, āĻĻā§āĻŦāĻŋāϤā§āϝāĻŧ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāĻĒāϰā§āϰ-āĻĄāĻžāύ āĻāĻŦāĻ āύāĻŋāĻā§āϰ-āĻŦāĻžāĻŽ āĻāϰā§āĻŖāĻžāϰ, āĻāĻŦāĻ āϤā§āϤā§āϝāĻŧ āĻā§āϝāĻžāϞā§āĻāĻŋ āύāĻŋāĻā§āϰ-āĻĄāĻžāύ āĻāϰā§āĻŖāĻžāϰā§āϰ āĻāύā§āϝ āĻĒā§āϰāϝā§āĻā§āϝ āĻšāĻŦā§āĨ¤
- āĻĻā§āĻāĻāĻŋ āĻā§āϝāĻžāϞā§āĻ āĻĒā§āϰāĻĨāĻŽ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāĻĒāϰā§āϰ-āĻŦāĻžāĻŽ āĻāĻŦāĻ āύāĻŋāĻā§āϰ-āĻĄāĻžāύ āĻāϰā§āĻŖāĻžāϰ, āĻĻā§āĻŦāĻŋāϤā§āϝāĻŧ āĻā§āϝāĻžāϞā§āĻāĻŋ āĻāĻĒāϰā§āϰ-āĻĄāĻžāύ āĻāĻŦāĻ āύāĻŋāĻā§āϰ-āĻŦāĻžāĻŽ āĻāϰā§āĻŖāĻžāϰā§āϰ āĻāύā§āϝ āĻĒā§āϰāϝā§āĻā§āϝ āĻšāĻŦā§āĨ¤
- āĻāĻāĻāĻŋ āĻā§āϝāĻžāϞā§āĻ āĻāĻžāϰāĻāĻŋ āĻāϰā§āĻŖāĻžāϰā§āϰ āĻāύā§āϝāĻ āĻĒā§āϰāϝā§āĻā§āϝ āĻšāĻŦā§āĨ¤
āĻāĻŦāĻžāϰ āĻāϞā§āύ āĻāĻāĻāĻž āĻāĻĻāĻžāĻšāϰāĻŖ āĻĻāĻŋāϝāĻŧā§ āĻŦā§āϝāĻžāĻĒāĻžāϰāĻāĻž āĻŦā§āĻā§ āύā§āϝāĻŧāĻž āϝāĻžāĻ :
<!DOCTYPE html>
<html>
<head>
<style>
#rcorners1 {
border-radius: 15px 50px 30px 5px;
background: #73AD21;
padding: 20px;
width: 200px;
height: 150px;
}
#rcorners2 {
border-radius: 15px 50px 30px;
background: #73AD21;
padding: 20px;
width: 200px;
height: 150px;
}
#rcorners3 {
border-radius: 15px 50px;
background: #73AD21;
padding: 20px;
width: 200px;
height: 150px;
}
#rcorners4 {
border-radius: 15px;
background: #73AD21;
padding: 20px;
width: 200px;
height: 150px;
}
</style>
</head>
<body>
<h1>The border-radius Property</h1>
<p>Four values - border-radius: 15px 50px 30px 5px:</p>
<p id="rcorners1">SAtech360</p>
<p>Three values - border-radius: 15px 50px 30px:</p>
<p id="rcorners2">SAtech360</p>
<p>Two values - border-radius: 15px 50px:</p>
<p id="rcorners3">SAtech360</p>
<p>One value - border-radius: 15px:</p>
<p id="rcorners4">SAtech360</p>
</body>
</html>
Output
The border-radius Property
Four values – border-radius: 15px 50px 30px 5px:
SAtech360
Three values – border-radius: 15px 50px 30px:
SAtech360
Two values – border-radius: 15px 50px:
SAtech360
One value – border-radius: 15px:
SAtech360
border-radius āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āĻāĻĒāύāĻŋ āĻāĻĒāĻŦā§āϤā§āϤāĻžāĻāĻžāϰ āĻāϰā§āĻŖāĻžāϰāĻ āϤā§āϰāĻŋ āĻāϰāϤ⧠āĻĒāĻžāϰā§āύāĻ
<!DOCTYPE html>
<html>
<head>
<style>
#rcorners1 {
border-radius: 50px / 15px;
background: #73AD21;
padding: 20px;
width: 200px;
height: 150px;
}
#rcorners2 {
border-radius: 15px / 50px;
background: #73AD21;
padding: 20px;
width: 200px;
height: 150px;
}
#rcorners3 {
border-radius: 50%;
background: #73AD21;
padding: 20px;
width: 200px;
height: 150px;
}
</style>
</head>
<body>
<h1>The border-radius Property</h1>
<p>Elliptical border - border-radius: 50px / 15px:</p>
<p id="rcorners1"></p>
<p>Elliptical border - border-radius: 15px / 50px:</p>
<p id="rcorners2"></p>
<p>Ellipse border - border-radius: 50%:</p>
<p id="rcorners3"></p>
</body>
</html>
Output
The border-radius Property
Elliptical border – border-radius: 50px / 15px:
Elliptical border – border-radius: 15px / 50px:
Ellipse border – border-radius: 50%:
āĻŦāĻŋāĻāĻĻā§āϰāĻborder-radius āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĻāĻŋ āĻāϏāϞā§Â border-top-left-radius, border-top-right-radius, border-bottom-right-radius āĻāĻŦāĻ border-bottom-left-radius āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏāĻŽā§āĻš āĻāĻāϤā§āϰ⧠āϏā§āĻ āĻāϰāĻžāϰ āĻāύā§āϝ āĻāĻāĻāĻŋ āϏāĻāĻā§āώāĻŋāĻĒā§āϤ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĨ¤ āϤāĻžāĻšāϞ⧠āĻāϞā§āύ āĻāĻā§āϞā§āϰ āĻĒā§āϰāϤā§āϝā§āĻāĻāĻŋāϰ āĻāĻāĻāĻž āĻāϰ⧠āĻāĻĻāĻžāĻšāϰāĻŖ āĻĻā§āĻāĻž āϝāĻžāĻ:
<!DOCTYPE html>
<html>
<head>
<style>
#example1 {
border: 2px solid red;
padding: 10px;
border-top-left-radius: 25px;
}
#example2 {
border: 2px solid red;
padding: 10px;
border-top-left-radius: 50px 20px;
}
#example3 {
border: 2px solid red;
border-top-right-radius: 25px;
}
#example4 {
border: 2px solid red;
border-top-right-radius: 50px 20px;
}
#example5 {
border: 2px solid red;
padding: 10px;
border-bottom-right-radius: 25px;
}
#example6 {
border: 2px solid red;
padding: 10px;
border-bottom-right-radius: 50px 20px;
}
#example7 {
border: 2px solid red;
padding: 10px;
border-bottom-left-radius: 25px;
}
#example8 {
border: 2px solid red;
padding: 10px;
border-bottom-left-radius: 50px 20px;
}
</style>
</head>
<body>
<h2>border-top-left-radius: 25px:</h2>
<div id="example1">
<p>The border-top-left-radius property defines the radius of the top-left corner.</p>
</div>
<h2>border-top-left-radius: 50px 20px:</h2>
<div id="example2">
<p>If two values are set; the first one is for the top border, the second one for the left border.</p>
</div>
<h2>border-top-right-radius: 25px:</h2>
<div id="example3">
<p>The border-top-right-radius property defines the radius of the top-right corner.</p>
</div>
<h2>border-top-right-radius: 50px 20px:</h2>
<div id="example4">
<p>If two values are set; the first one is for the top border, the second one for the right border.</p>
</div>
<br>
<h2>border-bottom-right-radius: 25px:</h2>
<div id="example5">
<p>The border-bottom-right-radius property defines the radius of the bottom-right corner.</p>
</div>
<br>
<h2>border-bottom-right-radius: 50px 20px:</h2>
<div id="example6">
<p>If two values are set; the first one is for the bottom border, the second one for the right border.</p>
</div>
<h2>border-bottom-left-radius: 25px:</h2>
<div id="example7">
<p>The border-bottom-left-radius property defines the radius of the bottom-left corner.</p>
</div>
<h2>border-bottom-left-radius: 50px 20px:</h2>
<div id="example8">
<p>If two values are set; the first one is for the bottom border, the second one for the left border.</p>
</div>
</body>
</html>
Output
border-top-left-radius: 25px:
The border-top-left-radius property defines the radius of the top-left corner.
border-top-left-radius: 50px 20px:
If two values are set; the first one is for the top border, the second one for the left border.
border-top-right-radius: 25px:
The border-top-right-radius property defines the radius of the top-right corner.
border-top-right-radius: 50px 20px:
If two values are set; the first one is for the top border, the second one for the right border.
border-bottom-right-radius: 25px:
The border-bottom-right-radius property defines the radius of the bottom-right corner.
border-bottom-right-radius: 50px 20px:
If two values are set; the first one is for the bottom border, the second one for the right border.
border-bottom-left-radius: 25px:
The border-bottom-left-radius property defines the radius of the bottom-left corner.
border-bottom-left-radius: 50px 20px:
If two values are set; the first one is for the bottom border, the second one for the left border.
CSS Border Images
HTML āĻāϞāĻŋāĻŽā§āύā§āĻāĻā§ āĻāϰāĻ āĻāĻāϰā§āώāĻŖā§āϝāĻŧ āĻāϰ⧠āĻāĻĒāϏā§āĻĨāĻžāĻĒāύ āĻāϰāĻžāϰ āĻāύā§āϝ āĻāĻĒāύāĻŋ āĻāĻāĻŋāϰ āĻāĻžāϰāĻĒāĻžāĻļā§ āĻāĻŽā§āĻ āĻŦāϰā§āĻĄāĻžāϰ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāϤ⧠āĻĒāĻžāϰā§āύāĨ¤ āĻāϰ CSS āĻ border-image āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻŽāĻžāϧā§āϝāĻŽā§ āĻāĻĒāύāĻŋ āĻāĻ āĻāĻžāĻāĻāĻŋ āĻā§āĻŦ āϏāĻšāĻā§āĻ āĻāϰāϤ⧠āĻĒāĻžāϰāĻŦā§āύāĨ¤ āĻŦāϰā§āĻĄāĻžāϰ āĻāĻŽā§āĻ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ ā§ŠāĻāĻŋ āĻ āĻāĻļ āĻĨāĻžāĻā§āĻ
- āĻŦāϰā§āĻĄāĻžāϰ āĻšāĻŋāϏā§āĻŦā§ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāĻžāϰ āĻāύā§āϝ āĻāĻāĻāĻŋ āĻāĻŽā§āĻāĨ¤
- āĻāĻŽā§āĻāĻāĻŋ āĻā§āĻĨāĻžāϝāĻŧ āϏā§āϞāĻžāĻāϏ āĻšāĻŦā§ āϤāĻž āύāĻŋāϰā§āĻĻā§āĻļ āĻāϰā§āĨ¤
- āĻŽāĻžāĻā§āϰ āϏā§āĻāĻļāύāĻāĻŋ āϰāĻŋāĻĒāĻŋāĻ āĻŦāĻž āĻĒā§āϰāϏāĻžāϰāĻŋāϤ āĻšāĻŦā§ āĻāĻŋāύāĻž āϤāĻž āύāĻŋāϰā§āĻĻā§āĻļ āĻāϰā§āĨ¤
āĻāĻĻāĻžāĻšāϰāĻŖ āĻšāĻŋāϏā§āĻŦā§ āĻāĻŽāϰāĻž āύāĻŋāĻŽā§āύā§āϰ âcss_border_image.jpgâ āĻāĻŽā§āĻāĻāĻŋ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āĻŦāϰā§āĻĄāĻžāϰ āϤā§āϰāĻŋ āĻāϰāĻŦā§āĻ

āĻāĻŽā§āĻāĻāĻŋāϰ āĻāĻžāϰāĻāĻŋ āĻāϰā§āĻŖāĻžāϰ āĻāĻā§āϤ āĻŦāĻĄāĻžāϰā§āϰ āĻāĻžāϰ āĻāϰā§āĻŖāĻžāϰ⧠āĻ āĻŦāϏā§āĻĨāĻžāύ āύāĻŋāĻŦā§ āĻāĻŦāĻ āĻāĻŽā§āĻā§āϰ āĻŽāĻžāĻā§āϰ āĻ āĻāĻļāĻāĻŋ āύāĻŋāϰā§āĻĻā§āĻļāĻŋāϤ āĻāĻĒāĻžāϝāĻŧā§ āĻŦāϰā§āĻĄāĻžāϰā§āϰ āĻŽāĻžāĻāĻāĻžāύā§āϰ āĻ āĻāĻļā§ āϰāĻŋāĻĒāĻŋāĻ āĻŦāĻž āĻĒā§āϰāϏāĻžāϰāĻŋāϤ āĻšāĻŦā§āĨ¤
āύā§āĻāĻ āĻā§āύ⧠HTML Element āĻ border-image āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāϤ⧠āĻšāϞā§, āĻĒā§āϰāĻĨāĻŽā§ āĻ Element āĻāϰ border āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āϏā§āĻ āĻāϰāϤ⧠āĻšāĻŦā§āĨ¤
<!DOCTYPE html>
<html>
<head>
<style>
#borderimg {
border: 50px solid transparent;
padding: 15px;
border-image: url(http://satech360.com/wp-content/uploads/2020/04/css_border_image.jpg) 30 round;
}
</style>
</head>
<body>
<h1>The border-image Property</h1>
<p>Here, the middle sections of the image are repeated to create the border:</p>
<p id="borderimg">border-image: url(css_border_image.jpg) 30 round;</p>
</body>
</html>
Output
The border-image Property
Here, the middle sections of the image are repeated to create the border:
border-image: url(css_border_image.jpg) 30 round;
āϤāĻŦā§ āĻāĻĒāύāĻŋ āĻāĻžāĻāϞ⧠āĻāĻŦāĻŋāϰ āĻŽāĻžāĻā§āϰ āĻ āĻāĻļāĻā§ āĻĒā§āϰāϏāĻžāϰāĻŋāϤ āĻāϰ⧠āĻŦāϰā§āĻĄāĻžāϰ āϤā§āϰāĻŋ āĻāϰāϤ⧠āĻĒāĻžāϰā§āύ :
<!DOCTYPE html>
<html>
<head>
<style>
#borderimg {
border: 50px solid transparent;
padding: 15px;
border-image: url(http://satech360.com/wp-content/uploads/2020/04/css_border_image.jpg) 30 stretch;
}
</style>
</head>
<body>
<h1>The border-image Property</h1>
<p>Here, the middle sections of the image are repeated to create the border:</p>
<p id="borderimg">border-image: url(css_border_image.jpg) 30 stretch;</p>
</body>
</html>
Output
The border-image Property
Here, the middle sections of the image are repeated to create the border:
border-image: url(css_border_image.jpg) 30 stretch;
CSS border-image-slice Property
border-image-slice Property āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āĻāĻĒāύāĻŋ āϏāĻŽā§āĻĒā§āϰā§āĻŖ āĻŦāϰā§āĻĄāĻžāϰāĻā§āĻ āĻĒāϰāĻŋāĻŦāϰā§āϤāύ āĻāϰ⧠āĻĻāĻŋāϤ⧠āĻĒāĻžāϰā§āύāĨ¤ āύāĻŋāĻŽā§āύ⧠āĻŦāĻŋāĻāĻŋāύā§āύ āϧāϰāύā§āϰ āϏā§āϞāĻžāĻāϏ āĻā§āϝāĻžāϞā§āϰ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻĻā§āĻāĻžāύ⧠āĻšāϞā§āĻ
<!DOCTYPE html>
<html>
<head>
<style>
#borderimg1 {
border: 10px solid transparent;
padding: 15px;
border-image: url(http://satech360.com/wp-content/uploads/2020/04/css_border_image.jpg) 50 round;
}
#borderimg2 {
border: 20px solid transparent;
padding: 15px;
border-image: url(http://satech360.com/wp-content/uploads/2020/04/css_border_image.jpg) 20% round;
}
#borderimg3 {
border: 20px solid transparent;
padding: 15px;
border-image: url(http://satech360.com/wp-content/uploads/2020/04/css_border_image.jpg) 30% round;
}
</style>
</head>
<body>
<h1>The border-image Property</h1>
<p id="borderimg1">border-image: url(css_border_image.jpg) 50 round;</p>
<p id="borderimg2">border-image: url(css_border_image.jpg) 20% round;</p>
<p id="borderimg3">border-image: url(css_border_image.jpg) 30% round;</p>
</body>
</html>
Output
The border-image Property
border-image: url(css_border_image.jpg) 50 round;
border-image: url(css_border_image.jpg) 20% round;
border-image: url(css_border_image.jpg) 30% round;
āϤāĻŦā§ border-image āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāĻāĻŋ āĻŦā§āϝāĻŦāĻšāĻžāϰ āύāĻž āĻāϰ⧠āĻāύā§āĻĄāĻŋāĻāĻŋāĻā§āϝāĻŧāĻžāϞ border-image-source, border-image-slice, border-image-width, border-image-outset āĻāĻŦāĻ border-image-repeat āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻā§āϞā§āĻ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāϤ⧠āĻĒāĻžāϰā§āύāĨ¤
Gradient Border
border-image āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞ⧠āĻšāĻŋāϏā§āĻŦā§ linear-gradient() āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰ⧠āĻāĻāĻāĻāĻŋāĻāĻŽāĻāϞ āĻāϞāĻŋāĻŽā§āύā§āĻā§ āĻā§āϰāĻžāĻĄāĻŋāϝāĻŧā§āύā§āĻ āĻŦāϰā§āĻĄāĻžāϰ āϏā§āĻ āĻāϰāĻž āϝāĻžāϝāĻŧāĨ¤
<!DOCTYPE html>
<html>
<head>
<style>
#grad_border {
border: 15px solid;
-webkit-border-image: linear-gradient(orange, red) 10;
-o-border-image: linear-gradient(orange, red) 10;
border-image: linear-gradient(orange, red) 10;
padding: 10px;
}
</style>
<title>CSS Gradient Border</title>
</head>
<body>
<p id="grad_border">CSS Gradient Border</p>
</body>
</html>
Output
CSS Gradient Border
CSS Outline āĻāĻŋ?
CSS Outline āĻšāϞ⧠āĻāĻāĻāĻŋ āϞāĻžāĻāύ āϝāĻž āϝā§āĻā§āύ⧠HTML Element āĻā§ āĻāϞāĻžāĻĻāĻžāĻāĻžāĻŦā§ āĻāĻĒāϏā§āĻĨāĻžāĻĒāύ āĻāϰāĻžāϰ āĻāύā§āϝ HTML Element āĻāϰ āĻŦāϰā§āĻĄāĻžāϰā§āϰ āĻŦāĻžāĻšāĻŋāϰ⧠āĻāĻāĻāĻž āĻšāϝāĻŧāĨ¤ CSS Outline Property āĻŦāϰā§āĻĄāĻžāϰ āĻšāϤ⧠āĻāĻŋāύā§āύ āĻāĻāĻāĻŋ Property. āĻāĻāĻŋ HTML Element āĻāϰ āĻŽāĻžāϰā§āĻāĻŋāύā§āϰ āĻ āĻāĻļ āύāϝāĻŧ āĻāĻŦāĻ CSS Outline āĻāϰ āĻĒā§āϰāϏā§āĻĨā§āϰ(width) āĻŽāĻžāϧā§āϝāĻŽā§ HTML Element āĻāϰ āĻĻā§āϰā§āĻā§āϝ āĻāĻŦāĻ āĻĒā§āϰāϏā§āĻĨā§āϰ āĻāĻĒāϰ⧠āĻā§āύ āĻĒā§āϰāĻāĻžāĻŦ āĻĒāĻĄāĻŧā§ āύāĻžāĨ¤ CSS outline Property āĻāϰ āĻŽāĻžāϧā§āϝāĻŽā§ HTML Element āĻāϰ Outline āĻāϰ style, color āĻāĻŦāĻ width āϏā§āĻ āĻāϰāĻž āϝāĻžāϝāĻŧāĨ¤ CSS Border āĻāĻŦāĻ Outline āĻāϰ āĻŽāϧā§āϝ⧠āĻĒāĻžāϰā§āĻĨāĻā§āϝ āĻŦā§āĻāĻžāϰ āĻāύā§āϝ āύāĻŋāĻā§āϰ āĻāĻŦāĻŋāĻāĻŋ āϞāĻā§āώā§āϝ āĻāϰā§āύ:

āĻāĻ āύāĻāϰ⧠āϏāĻŋāĻāϏāĻāϏ āĻāĻāĻāϞāĻžāĻāύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏāĻŽā§āĻš
- outline-style
- outline-color
- outline-width
- outline-offset
- outline
outline-style
āĻāĻāĻāϞāĻžāĻāύā§āϰ āϏā§āĻāĻžāĻāϞ āϏā§āĻ āĻāϰāĻžāϰ āĻāύā§āϝ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāĻž āĻšāϝāĻŧāĨ¤
outline-style āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϤ⧠āύāĻŋāĻā§āϰ āĻā§āϝāĻžāϞā§āϏāĻŽā§āĻš āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāĻž āϝāĻžāϝāĻŧāĻ
- solid â āĻāĻāĻāĻŋ āϏāϞāĻŋāĻĄ āĻāĻāĻāϞāĻžāĻāύ āϤā§āϰā§āϰ āĻāύā§āϝ āĻŦā§āϝāĻŦāĻšā§āϤ āĻšāϝāĻŧāĨ¤
- double â āĻāĻāĻāĻŋ āĻĄāĻžāĻŦāϞ āĻāĻāĻāϞāĻžāĻāύ āϤā§āϰā§āϰ āĻāύā§āϝ āĻŦā§āϝāĻŦāĻšā§āϤ āĻšāϝāĻŧāĨ¤
- dotted â āĻāĻāĻāĻŋ āĻĄāĻā§āĻĄ āĻāĻāĻāϞāĻžāĻāύ āϤā§āϰā§āϰ āĻāύā§āϝ āĻŦā§āϝāĻŦāĻšā§āϤ āĻšāϝāĻŧāĨ¤
- dashed â āĻāĻāĻāĻŋ āĻĄā§āϝāĻžāĻļ āĻāĻāĻāϞāĻžāĻāύ āϤā§āϰā§āϰ āĻāύā§āϝ āĻŦā§āϝāĻŦāĻšā§āϤ āĻšāϝāĻŧāĨ¤
- inset â āĻāĻāĻāĻŋ 3D inset āĻāĻāĻāϞāĻžāĻāύ āϤā§āϰā§āϰ āĻāύā§āϝ āĻŦā§āϝāĻŦāĻšā§āϤ āĻšāϝāĻŧāĨ¤ outline-color āĻāϰ āĻā§āϝāĻžāϞā§āϰ āĻāĻĒāϰ āĻĒā§āϰāĻāĻžāĻŦ āύāĻŋāϰā§āĻāϰ āĻāϰā§āĨ¤
- outset â āĻāĻāĻāĻŋ 3D outset āĻāĻāĻāϞāĻžāĻāύ āϤā§āϰā§āϰ āĻāύā§āϝ āĻŦā§āϝāĻŦāĻšā§āϤ āĻšāϝāĻŧāĨ¤ outline-color āĻāϰ āĻā§āϝāĻžāϞā§āϰ āĻāĻĒāϰ āĻĒā§āϰāĻāĻžāĻŦ āύāĻŋāϰā§āĻāϰ āĻāϰā§āĨ¤
- groove â āĻāĻāĻāĻŋ 3D groove āĻāĻāĻāϞāĻžāĻāύ āϤā§āϰā§āϰ āĻāύā§āϝ āĻŦā§āϝāĻŦāĻšā§āϤ āĻšāϝāĻŧāĨ¤ outline-color āĻāϰ āĻā§āϝāĻžāϞā§āϰ āĻāĻĒāϰ āĻĒā§āϰāĻāĻžāĻŦ āύāĻŋāϰā§āĻāϰ āĻāϰā§āĨ¤
- ridge â āĻāĻāĻāĻŋ 3D ridge āĻāĻāĻāϞāĻžāĻāύ āϤā§āϰā§āϰ āĻāύā§āϝ āĻŦā§āϝāĻŦāĻšā§āϤ āĻšāϝāĻŧāĨ¤ outline-color āĻāϰ āĻā§āϝāĻžāϞā§āϰ āĻāĻĒāϰ āĻĒā§āϰāĻāĻžāĻŦ āύāĻŋāϰā§āĻāϰ āĻāϰā§āĨ¤
- hidden â āĻāĻāĻāϞāĻžāĻāύāĻā§ āĻšāĻžāĻāĻĄ āĻāϰāĻžāϰ āĻāύā§āϝ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāĻž āĻšāϝāĻŧāĨ¤
- none â āĻā§āύ āĻāĻāĻāϞāĻžāĻāύ āύāĻž āĻĒā§āϰāĻĻāϰā§āĻļāύā§āϰ āĻāύā§āϝ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāĻž āĻšāϝāĻŧāĨ¤
āύāĻŋāĻŽā§āύā§āϰ āĻāĻĻāĻžāĻšāϰāĻŖā§, āĻĒā§āϰāϤā§āϝā§āĻāĻāĻŋ <p> Element āĻ āĻāĻŋāύā§āύ āĻāĻŋāύā§āύ outline-style āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϰ āĻā§āϝāĻžāϞā§āϏāĻŽā§āĻš āϏā§āĻ āĻāϰ⧠āĻĻā§āĻāĻžāύ⧠āĻšāϞā§āĻ
<!DOCTYPE html>
<html>
<head>
<style>
p {
outline-color:red;
outline-width: 4px;
}
p.dotted {outline-style: dotted;}
p.dashed {outline-style: dashed;}
p.solid {outline-style: solid;}
p.double {outline-style: double;}
p.groove {outline-style: groove;}
p.ridge {outline-style: ridge;}
p.inset {outline-style: inset;}
p.outset {outline-style: outset;}
</style>
</head>
<body>
<h2>The outline-style Property</h2>
<p class="dotted">A dotted outline</p>
<p class="dashed">A dashed outline</p>
<p class="solid">A solid outline</p>
<p class="double">A double outline</p>
<p class="groove">A groove outline. The effect depends on the outline-color value.</p>
<p class="ridge">A ridge outline. The effect depends on the outline-color value.</p>
<p class="inset">An inset outline. The effect depends on the outline-color value.</p>
<p class="outset">An outset outline. The effect depends on the outline-color value.</p>
</body>
</html>
Output

Outline â Shorthand property
āĻāĻāĻāĻŋ Outline Property āĻāϰ āĻŽāϧā§āϝ⧠āϏāĻŦāĻā§āϞ⧠Outline Property āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāĻžāϰ āĻāύā§āϝ Outline shorthand Property āĻŦā§āϝāĻŦāĻšā§āϤ āĻšāϝāĻŧ
āύāĻŋāĻā§āϰ āĻāĻĒ-āĻāĻāĻāϞāĻžāĻāύ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋāϏāĻŽā§āĻšā§āϰ āĻļāϰā§āĻāĻāĻžāĻ āĻĒā§āϰā§āĻĒāĻžāϰā§āĻāĻŋ āĻšāϞ⧠outline
- outline-width
- outline-style(āĻāĻŦāĻļā§āϝāĻ)
- outline-color
āύāĻŋāĻā§āϰ āĻāĻĻāĻžāĻšāϰāĻŖāĻāĻŋ āϞāĻā§āώā§āϝ āĻāϰā§āύ:
<!DOCTYPE html>
<html>
<head>
<style>
p.outline1 {outline: dashed;}
p.outline2 {outline: dotted red;}
p.outline3 {outline: 5px solid yellow;}
p.outline4 {outline: thick ridge pink;}
</style>
</head>
<body>
<h2>The outline Property</h2>
<p class="outline1">A dashed outline.</p>
<p class="outline2">A dotted red outline.</p>
<p class="outline3">A 5px solid yellow outline.</p>
<p class="outline4">A thick ridge pink outline.</p>
</body>
</html>
Output
