htmlcss

How to draw a dotted line with css?


How can I draw a dotted line with CSS?


Solution

  • 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.