1

enter image description here

I want to create a line with circles. Can this be done with background-repeat? Or do I need to set a picture as background? The circles should have a 5px radius.

p:after {
   content: '';
   background: 'rounded div of size 10x10px' repeat-x
   width: 50%;
}
vuvu
  • 4,886
  • 12
  • 50
  • 73

2 Answers2

2

This is the only solution without using background-image or border-image encoded in base64 or using external files.

https://jsfiddle.net/3r6xsr0m/

html:

<div class="line"></div>

css:

.line:before {
    content: "..................................................................................................";
    display: block;
    font-size: 60px;
    font-family: Georgia;
    color: #aaa;
    max-width: 100%;
    overflow: hidden;
}

Dots may differ depending of browser font rendering algorithm.

Dariusz Sikorski
  • 4,309
  • 5
  • 27
  • 44
0

You'll have to create a 10px x 10px image of the dot and then use your method of repeating the background using either pseudo or just a new element. I'd go with a new div element if you can to prevent any issues across browsers like IE8. You'll also have to give your element a width if you go pseudo.

artslop
  • 39
  • 4