logo CBCE Skill INDIA

Welcome to CBCE Skill INDIA. An ISO 9001:2015 Certified Autonomous Body | Best Quality Computer and Skills Training Provider Organization. Established Under Indian Trust Act 1882, Govt. of India. Identity No. - IV-190200628, and registered under NITI Aayog Govt. of India. Identity No. - WB/2023/0344555. Also registered under Ministry of Micro, Small & Medium Enterprises - MSME (Govt. of India). Registration Number - UDYAM-WB-06-0031863

How to set hr color in HTML?


In HTML, you can use the <hr> (horizontal rule) element to create a horizontal line, typically used to separate content sections. To set the color of the <hr> element, you can use the CSS border-color property. Here's an example of how to do it:

<!DOCTYPE html>
<html>
<head>
<style>
  /* CSS to set the color of the <hr> element */
  hr {
    border-color: red; /* You can replace "red" 
    with any color you want */
  }
</style>
</head>
<body>

<h2>Content Section 1</h2>
<p>This is the content of section 1.</p>
<hr>

<h2>Content Section 2</h2>
<p>This is the content of section 2.</p>
<hr>

</body>
</html>

In this example, the <hr> element will have a red color. You can replace "red" with any valid CSS color value (e.g., hexadecimal, RGB, color name) to achieve the color you want for the horizontal line.

Thank You

Popular Post:

Give us your feedback!

Your email address will not be published. Required fields are marked *
0 Comments Write Comment