How can I draw a dotted line with CSS?
You could just have <hr style="border-top: dotted 1px;" /> . That should work.
Its simple to add a horizontal line in your markup, just add: <hr>. Browsers draw a line across the entire width of the container, which can be the entire body or a child element.
For example:
hr { border: none; border-top: 1px dotted #f00; color: #fff; background-color: #fff; height: 1px; width: 50%; }
before <hr> after
See also Styling <hr>
with CSS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With