October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk2 min

How to Create a Horizontal Line with Small Circles at Both Ends in CSS

Use CSS pseudo-elements for a compact decorative rule with 10px circles, a behind-the-dots connector for progress steps, or SVG for coordinate-based control.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a decorative divider with 10px circles at each end, make one relatively positioned element for the line and add the circles with its ::before and ::after pseudo-elements. If the circles are separate items in a progress indicator, use a connector behind them instead.

Make a decorative divider with CSS

This single-element pattern keeps the HTML minimal. The line is 4px tall; each endpoint is 10px across, with its center aligned to the line’s center.

As an Amazon Associate I earn from qualifying purchases.

<div class="rule" aria-hidden="true"></div>
.rule {
  position: relative;
  height: 4px;
  background: #000;
  margin: 1rem 0;
}
.rule::before,
.rule::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #000;
  transform: translateY(-50%);
}
.rule::before { left: 0; }
.rule::after { right: 0; }

Set equal width and height values to keep the endpoints circular; border-radius: 50% rounds them. The top: 50% and translateY(-50%) combination centers each dot vertically on the rule. Change the shared background color to style the line and dots together.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

aria-hidden="true" is appropriate when the divider is purely decorative. If it communicates information or a relationship, do not hide it from assistive technology; provide suitable semantics for that use.

Connect separate circles in a progress indicator

When the circles are actual content nodes, such as steps in a progress indicator, draw the connector on their positioned parent. The pseudo-element spans the parent, while the dots sit above it in the stacking order.

<div class="steps">
  <span class="dot"></span>
  <span class="dot"></span>
  <span class="dot"></span>
</div>
.steps {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.steps::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 3px solid #ACCF5B;
  z-index: 0;
}
.steps .dot {
  position: relative;
  z-index: 1;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #22bacb;
}

The connector stretches across the available width, and the dots remain in front of it. Adjust the parent’s width and the dot dimensions to suit the layout. This pattern is intended for separate nodes; use the single-element version when you only need a decorative rule.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When SVG is a better fit

Use SVG when the line and endpoints are part of a reusable graphic or you need precise coordinate-based control. A <line> defines the connector, and two <circle> elements define its ends:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<svg viewBox="0 0 220 20" role="img" aria-label="Horizontal line with circular endpoints">
  <line x1="10" y1="10" x2="210" y2="10" stroke="currentColor" stroke-width="2" />
  <circle cx="10" cy="10" r="5" fill="currentColor" />
  <circle cx="210" cy="10" r="5" fill="currentColor" />
</svg>

Because the line’s y-coordinates are both 10, it is horizontal. Each circle has a radius of 5, making it 10 units in diameter. SVG scales as a vector graphic, while CSS is usually simpler for a divider that belongs to a page layout. For the SVG line element’s role, see the W3Schools SVG line reference; examples of the line and circle primitives are also available in the SVG examples.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.