css horizontal line code example
Example 1: how to change the color of the hr tag in html
<style>
hr{
height: 1px;
background-color: #ccc;
border: none;
}
</style>
Example 2: html horizontal line style
<!-- HTML -->
<!-- You can change the style of the horizontal line like this: -->
<hr style="width:50%", size="3", color=black>
<!-- Or like this: -->
<hr style="height:2px; width:50%; border-width:0; color:red; background-color:red">
Example 3: how to style an hr tag
hr.new1 {
border-top: 1px solid red;
}
hr.new2 {
border-top: 1px dashed red;
}
hr.new3 {
border-top: 1px dotted red;
}
hr.new4 {
border: 1px solid red;
}
hr.new5 {
border: 10px solid green;
border-radius: 5px;
}
Example 4: horizontal line html
<!-- code -->
<hr>
<!-- code -->
Example 5: horizontal line
Incase you are trying to diffrentiate between verical and horizontal. this is a horizontal line
------------
<!--Then Vertical goes straight from top to bottom. -->
<!--to add a horizontal line in html-->
<hr>
Example 6: how to draw a horizontal line in javascript
var elem = document.createElement("hr");
elem.setAttribute("width", "100px");
document.body.appendChild(elem);