0
Please i need to know if i can change the color of an img border in html and how
4 Answers
+ 2
Try this
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<style>
img {
border: 5px solid #000000;
}
</style>
<img src="https://assets-prd.ignimgs.com/2022/08/17/top25animecharacters-blogroll-1660777571580.jpg" alt="Example Image">
</body>
</html>
+ 1
With the attribute âborderâ you can change the color. Example: border: 10px solid blue
+ 1
To change the color of an image border in CSS, you can use the following code:
img { border-color: #000000; /* replace #000000 with the desired color code */ }
Alternatively, you can also use the shorthand version:
img { border: 2px solid #000000; /* replace 2px with the desired border width and #000000 with the desired color code */ }
0
It didn't work, can you write out the code it the way it should be?