23VNM009 Gopinath
23VNM009 Gopinath
ROLL NUMBER:23VNM009
SUBJECT:WEB TECHNOLOGY
CSS BORDER COLOR
1.HTML:
To set the border color of an element in HTML using CSS, you can use the border-color
property. You can set the color of all four borders simultaneously or specify each border
individually
<!DOCTYPE html>
<html lang="en">
<head>
<title>Border Color Example</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1 class="example">GOPINATH V</h1>
<p class="example1">23VNM009</p>
<p class="example2">2nd BACHELOR OF VOCATIONAL NETWORKING AND MOBILE
APPLICATION</p>
<p class="example3">PSG COLLEGE OF ARTS & SCIENCE</p>
</body>
</html>
2.CSS:
.example {
border-width: 2px;
border-style: solid;
border-top-color: red;
border-right-color: green;
border-bottom-color: blue;
border-left-color: yellow;
}
.example1 {
border-width: 2px;
border-style: solid;
border-top-color: red;
border-right-color: green;
border-bottom-color: blue;
border-left-color: yellow;
}
.example2 {
border-width: 2px;
border-style: solid;
border-top-color: red;
border-right-color: green;
border-bottom-color: blue;
border-left-color: yellow;
}
.example3 {
border-width: 2px;
border-style: solid;
border-top-color: red;
border-right-color: green;
border-bottom-color: blue;
border-left-color: yellow;
}
body{
border-width: 2px;
border-style:double ;
background-color: lightblue;
text-align: center;
}
3.EXPLANATION:
i. ou can replace red, green, blue, and yellow with any valid CSS color value (e.g.,
#FF0000, rgb(255, 0, 0), etc.).
ii. The border color can be set individually for each side using border-top-color, border-
right-color, border-bottom-color, and border-left-color.
iii. The shorthand border-color property can set the colors in the order of top, right, bottom,
and left.
4.OUTPUT: