hr color css code example
Example 1: css thinner hr
hr {
border: none;
height: 1px;
/* Set the hr color */
color: #333; /* old IE */
background-color: #333; /* Modern Browsers */
}
Example 2: how to change the color of the hr tag in html
<style>
hr{
height: 1px;
background-color: #ccc;
border: none;
}
</style>
Example 3: css hr color
hr { border: 0; border-top: 1px solid #dee2e6; }
Example 4: html horizontal line style
<hr style="width:50%", size="3", color=black>
<hr style="height:2px; width:50%; border-width:0; color:red; background-color:red">
Example 5: how to style an hr tag
/* 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;
}