Answers for "css how to change hr color"

0

change the color of an hr

hr {
        height: 1px;
        background-color: #ccc;
        border: none;
    }
Posted by: Guest on February-02-2021
0

add color to hr tag

<style>
/* Red border */
hr.new1 {
  border-top: 1px solid red;
}

/* Dashed red border */
hr.new2 {
  border-top: 1px dashed red;
}

/* Dotted red border */
hr.new3 {
  border-top: 1px dotted red;
}

/* Thick red border */
hr.new4 {
  border: 1px solid red;
}

/* Large rounded green border */
hr.new5 {
  border: 10px solid green;
  border-radius: 5px;
}
</style>
 
<h2>Style HR</h2>
<p>Default:</p>
<hr>
<p>Different styles of HR:</p>
<hr class="new1">
<hr class="new2">
<hr class="new3">
<hr class="new4">
<hr class="new5">
Posted by: Guest on January-14-2021

Browse Popular Code Answers by Language