CSS Dividers: 16 Waves, Angles and Section Breaks

Borders, gradients, pseudo-elements and clipped shapes can all split a page into sections without a single image file. A divider earns its place where it marks a boundary that spacing alone fails to show.

Below are 16 CSS dividers you can try and copy, from styled hr rules to wave, slanted and torn section breaks, followed by a guide to picking the method and keeping each one accessible.

By Bogdan Sandu ยท Updated October 28, 2026

Content separators

Dividers that live inside the content: styled hr rules, labeled lines, toolbar separators and list rules. An hr is announced as a separator, so use it where the topic changes, and draw purely visual lines with borders or pseudo-elements.

Four hr styles for long reads

  • border-top on hr
  • border-style: double
  • ::after glyph

The harbor was quiet by nine.


By ten, the boats were back.

Thin rule, 60% wide

Part one ends at the station.


Part two opens on the train.

Dotted rule, 4px

Subtotal for October


Balance carried forward

Double rule, print style

She closed the letter there.


Three years passed.

Ornament through ::after

Each rule is a native hr, so screen readers still announce a separator. The reset is the same every time: border: 0 removes the inset default, then a single border-top draws the line. The ornament hides its line and prints a section sign through ::after, with empty alt text in the content value so the glyph is not read out.

View code
.dv-rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 16px;
  width: min(100%, 580px);
}
.dv-rules__tile {
  margin: 0;
  padding: 22px 22px 16px;
  border-radius: 14px;
  background: #fffdf8;
  color: #2a2620;
  box-shadow: 0 1px 0 #e7e1d4, 0 10px 24px rgba(40, 32, 20, .06);
}
.dv-rules__tile p {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 17px;
  line-height: 1.4;
  text-align: center;
}
.dv-rules__tile figcaption {
  margin-top: 16px;
  color: #6b6355;
  font: 600 12px/1.3 ui-monospace, Consolas, monospace;
  text-align: center;
}
.dv-rules__hr {
  height: 0;
  margin: 16px auto;
  overflow: visible;
  border: 0;
  background: none;
}
.dv-rules__hr--thin {
  width: 60%;
  border-top: 1px solid #c9bfab;
}
.dv-rules__hr--dotted {
  width: 40%;
  border-top: 4px dotted #b4552d;
}
.dv-rules__hr--double {
  width: 100%;
  border-top: 4px double #2a2620;
}
.dv-rules__hr--ornament {
  height: auto;
  color: #b4552d;
  text-align: center;
}
.dv-rules__hr--ornament::after {
  content: "\00A7";
  content: "\00A7" / "";
  display: inline-block;
  font-family: "Fraunces", Georgia, serif;
  font-size: 22px;
  line-height: 1;
}

Or between sign-in options

  • flex row
  • ::before / ::after
  • flex: 1 lines

The word or sits in a flex row, and two empty pseudo-elements with flex: 1 and a border-top take whatever width the label leaves. The paragraph has no separator role on purpose: children of a separator are presentational, and the word should stay readable.

View code
.dv-login {
  display: grid;
  gap: 10px;
  width: min(100%, 360px);
  padding: 28px 24px;
  border-radius: 18px;
  background: #fff;
  color: #141821;
  box-shadow: 0 18px 40px rgba(20, 24, 33, .08);
}
.dv-login__title {
  margin: 0 0 8px;
  color: #141821;
  font-family: inherit;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.dv-login__alt,
.dv-login__go {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.dv-login__alt {
  border: 1px solid #d5d9e3;
  background: #fff;
  color: #141821;
  transition: background-color .2s ease;
}
.dv-login__alt:hover {
  background: #f3f5f9;
}
.dv-or {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0;
  color: #5b6170;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.dv-or::before,
.dv-or::after {
  content: "";
  flex: 1;
  border-top: 1px solid #dfe2ea;
}
.dv-login__label {
  font-size: 14px;
  font-weight: 600;
}
.dv-login__input {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #b9bfcc;
  border-radius: 10px;
  background: #fff;
  color: #141821;
  font: inherit;
  font-size: 15px;
}
.dv-login__input::placeholder {
  color: #6b7180;
}
.dv-login__go {
  border: 0;
  background: #0f6b53;
  color: #fff;
  transition: background-color .2s ease;
}
.dv-login__go:hover {
  background: #0b5541;
}
.dv-login button:focus-visible,
.dv-login__input:focus-visible {
  outline: 3px solid #0f6b53;
  outline-offset: 2px;
}

Icon in the middle of a menu card

  • role="separator"
  • inline SVG icon
  • currentColor lines

Autumn tasting menu

Charred leeks

hazelnut, brown butter, sorrel

Hake, mussel broth

fennel, saffron, sea herbs

Quince tart

bay leaf custard, crรจme fraรฎche

A div with role="separator" can hold an icon, because the role makes its children presentational anyway. The lines are ::before and ::after with flex: 1, and both they and the SVG use currentColor, so one color value restyles the whole divider.

View code
.dv-menu {
  width: min(100%, 380px);
  padding: 30px 28px;
  border: 1px solid #d9cba8;
  border-radius: 4px;
  background: #f7f1e3;
  color: #23402f;
  text-align: center;
}
.dv-menu__title {
  margin: 0 0 22px;
  color: #23402f;
  font-family: "Fraunces", Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
}
.dv-menu__course p {
  margin: 0;
}
.dv-menu__dish {
  font-family: "Fraunces", Georgia, serif;
  font-size: 18px;
  font-weight: 600;
}
.dv-menu__desc {
  margin-top: 4px;
  color: #4d5b4f;
  font-size: 14px;
}
.dv-menu__sep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px auto;
  width: 70%;
  color: #8a6420;
}
.dv-menu__sep::before,
.dv-menu__sep::after {
  content: "";
  flex: 1;
  border-top: 1px solid currentColor;
}
.dv-menu__sep svg {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

Vertical separators in an editor toolbar

  • aria-orientation="vertical"
  • align-self: stretch
  • roving tabindex

Shipping notes for the Lisbon pop-up: tables arrive Thursday, signage on Friday morning.

Inside role="toolbar", the groups are split by divs with role="separator" and aria-orientation="vertical", since a separator defaults to horizontal. Each line is a 1px element with align-self: stretch, so it takes the toolbar height without a fixed value. Arrow keys move between buttons, the pattern a toolbar role promises.

View code
.dv-editor {
  width: min(100%, 420px);
  border: 1px solid #d6dae3;
  border-radius: 14px;
  background: #fff;
  color: #1a1f2b;
  box-shadow: 0 14px 34px rgba(26, 31, 43, .08);
}
.dv-tb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid #e3e6ed;
}
.dv-tb__btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #3a4255;
  font: inherit;
  font-size: 17px;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.dv-tb__btn--b {
  font-weight: 800;
}
.dv-tb__btn--i {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
}
.dv-tb__btn--u {
  text-decoration: underline;
}
.dv-tb__btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}
.dv-tb__btn svg circle {
  fill: currentColor;
  stroke: none;
}
.dv-tb__btn:hover {
  background: #f1f3f7;
}
.dv-tb__btn[aria-pressed="true"] {
  background: #e3e9ff;
  color: #2342c4;
}
.dv-tb__btn:focus-visible {
  outline: 2px solid #2342c4;
  outline-offset: 1px;
}
.dv-tb__sep {
  align-self: stretch;
  width: 1px;
  margin: 6px 6px;
  background: #d0d5df;
}
.dv-editor__text {
  margin: 0;
  padding: 18px 18px 22px;
  font-size: 15px;
  line-height: 1.55;
}
.dv-editor:has([data-cmd="bold"][aria-pressed="true"]) .dv-editor__text {
  font-weight: 700;
}
.dv-editor:has([data-cmd="italic"][aria-pressed="true"]) .dv-editor__text {
  font-style: italic;
}
.dv-editor:has([data-cmd="underline"][aria-pressed="true"]) .dv-editor__text {
  text-decoration: underline;
}

Inset rules in a settings list

  • :not(:last-child)
  • inset ::after line
  • no extra markup

The line under each row starts where the text starts, not at the icon, the way native settings screens do it. li:not(:last-child) puts it on every row except the last, so the group ends on the card edge instead of a stray rule, and no hr is added to the list.

View code
.dv-set {
  width: min(100%, 380px);
  color: #16161a;
}
.dv-set__title {
  margin: 0 0 8px 16px;
  color: #55555e;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.3;
}
.dv-set__list {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  list-style: none;
}
.dv-set__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 0 16px;
  color: #16161a;
  font-size: 16px;
  text-decoration: none;
  transition: background-color .15s ease;
}
.dv-set__row:hover {
  background: #f4f4f7;
}
.dv-set__list li:not(:last-child) .dv-set__row::after {
  content: "";
  position: absolute;
  left: 60px;
  right: 0;
  bottom: 0;
  border-bottom: 1px solid #dcdce2;
}
.dv-set__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--dv-c);
  color: #fff;
}
.dv-set__icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dv-set__name {
  flex: 1;
}
.dv-set__value {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #63636c;
  font-size: 15px;
}
.dv-set__value::after {
  content: "";
  width: 7px;
  height: 7px;
  border-top: 2px solid #a4a4ad;
  border-right: 2px solid #a4a4ad;
  transform: rotate(45deg);
}
.dv-set__row:focus-visible {
  outline: 2px solid #5146d8;
  outline-offset: -2px;
}

Three-dot break in a changelog

  • hr::before
  • box-shadow copies
  • no gradient

Version 4.2

Shared boards now sync offline edits when you reconnect, and comments keep their thread order.


Version 4.1

New keyboard shortcuts for moving cards between columns. Exports include archived lists.


Version 4.0

A rebuilt timeline view with week and quarter zoom levels.

One pseudo-element draws one dot, and two box-shadows with no blur copy it to the left and right. The hr keeps its separator role between release entries, and the dot color comes from a single custom property.

View code
.dv-log {
  --dv-dot: #8f9cff;
  width: min(100%, 440px);
  padding: 26px 26px 28px;
  border: 1px solid #262c3b;
  border-radius: 16px;
  background: #151925;
  color: #e7e9f0;
}
.dv-log__entry p {
  margin: 0;
  color: #b3bacb;
  font-size: 15px;
  line-height: 1.55;
}
.dv-log .dv-log__ver {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 6px;
  color: #f4f5fa;
  font-size: 16px;
  font-weight: 700;
}
.dv-log__ver time {
  color: #9aa3b8;
  font: 500 13px/1.6 ui-monospace, Consolas, monospace;
}
.dv-log__dots {
  position: relative;
  height: 6px;
  margin: 22px 0;
  overflow: visible;
  border: 0;
  background: none;
}
.dv-log__dots::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--dv-dot);
  box-shadow: -18px 0 var(--dv-dot), 18px 0 var(--dv-dot);
}

Wave and curve section dividers

Decorative shapes between full-width page sections. Each SVG uses preserveAspectRatio="none" and width: 100%, so it stretches to the section instead of overflowing it, and every shape is aria-hidden because it carries no meaning.

Single wave under a hero

  • inline SVG path
  • preserveAspectRatio="none"
  • fill from next section

Payroll that runs itself

Pay a team in 40 countries from one dashboard. Filings, payslips and tax forms go out on schedule.

Start a free trial
Same-day payRun off-cycle payments in minutes.
Local contractsTemplates checked for each country.
One invoiceA single monthly bill in your currency.

Resize the window: the shapes stretch with the section.

The SVG sits between the two sections with the hero color as its background and the next section color as its path fill, so the wave looks cut out of the hero. preserveAspectRatio="none" with width: 100% stretches the path to any width, and display: block removes the gap an inline SVG leaves below itself.

View code
.dv-wave {
  --dv-hero: #0b4f4a;
  --dv-next: #f7f5ef;
  color: #1c2422;
}
.dv-wave__hero {
  padding: 48px 24px 12px;
  background: var(--dv-hero);
  color: #e9f4f1;
  text-align: center;
}
.dv-wave__title {
  margin: 0 0 10px;
  color: #fff;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.15;
}
.dv-wave__hero p {
  max-width: 460px;
  margin: 0 auto 20px;
  font-size: 16px;
  line-height: 1.5;
}
.dv-wave .dv-wave__cta {
  display: inline-block;
  padding: 13px 22px;
  border-radius: 999px;
  background: #f2c14e;
  color: #0b1f1d;
  font-weight: 700;
  text-decoration: none;
}
.dv-wave__cta:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.dv-wave__edge {
  display: block;
  width: 100%;
  height: clamp(48px, 8vw, 100px);
  margin-top: -1px;
  background: var(--dv-hero);
}
.dv-wave__edge path {
  fill: var(--dv-next);
}
.dv-wave__next {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 18px;
  margin-top: -1px;
  padding: 12px 24px 40px;
  background: var(--dv-next);
}
.dv-wave__next strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}
.dv-wave__next span {
  color: #4a5552;
  font-size: 14px;
  line-height: 1.5;
}

Layered waves stepping into the next color

  • stacked SVG paths
  • solid color steps
  • one viewBox

Low Tide Festival

Three nights on the dunes, 14 to 16 August. Early-bird passes until Friday.

Friday Saltmarsh, The Gull Choir, Nova Reyes

Saturday Kite Theory, Marrow, Iris Lane

Resize the window: the shapes stretch with the section.

Four paths in one SVG, each a solid color and each sitting a little lower than the last. The steps walk from the dark hero to the light section below without any gradient, and the last path uses the exact color of the next section so the seam disappears.

View code
.dv-layers__hero {
  padding: 46px 24px 16px;
  background: #2b1846;
  color: #f1dccb;
}
.dv-layers__title {
  margin: 0 0 8px;
  color: #fdebd8;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  font-style: italic;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.dv-layers__hero p {
  max-width: 420px;
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}
.dv-layers__edge {
  display: block;
  width: 100%;
  height: clamp(64px, 11vw, 140px);
  margin-top: -1px;
  background: #2b1846;
}
.dv-layers__next {
  display: grid;
  gap: 8px;
  margin-top: -1px;
  padding: 8px 24px 36px;
  background: #fdebd8;
  color: #3a1f33;
}
.dv-layers__day {
  display: grid;
  grid-template-columns: 84px 1fr;
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}
.dv-layers__day strong {
  color: #8f2f4c;
}

Curve from an oversized ellipse

  • border-radius: 50% / 100%
  • pseudo-element
  • no SVG

Savings that grow on autopilot

Northbeam rounds up every card payment and moves the change to a 3.1% savings pot.

12 minto open an account
0 feeson transfers between pots
24/7support in the app

Resize the window: the shapes stretch with the section.

A pseudo-element hangs below the top section, wider than the section itself, with a bottom radius of 50% horizontally and 100% vertically. Only the gentle middle of that ellipse shows, which reads as a smooth arc. The root clips the overflow, so the extra width never causes a horizontal scrollbar.

View code
.dv-arc {
  overflow: hidden;
  overflow: clip;
  background: #f3f5fb;
}
.dv-arc__top {
  position: relative;
  z-index: 1;
  padding: 44px 24px 16px;
  background: #1d3a8a;
  color: #dfe6fb;
  text-align: center;
}
.dv-arc__top::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -15%;
  right: -15%;
  height: clamp(36px, 7vw, 76px);
  margin-top: -1px;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background: #1d3a8a;
}
.dv-arc__title {
  margin: 0 0 10px;
  color: #fff;
  font-family: inherit;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.dv-arc__top p {
  max-width: 440px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.5;
}
.dv-arc__bottom {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 16px;
  padding: clamp(64px, 10vw, 104px) 24px 36px;
  color: #1b2440;
  text-align: center;
}
.dv-arc__bottom strong {
  display: block;
  color: #1d3a8a;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.dv-arc__bottom span {
  color: #4d5670;
  font-size: 14px;
}

Drifting tide wave with a pause button

  • translateX loop
  • animation-play-state
  • prefers-reduced-motion

Tide tables, Porthkerry Bay

High water 06:42, 3.1 m. Low water 12:58, 0.6 m.

Swell 1.2 m from the south-west, 11 s period. Good for longboards on the mid tide.

Use the Pause wave button to stop the motion.

Two SVGs twice the section width hold a repeating wave, and moving them by exactly half their width makes the loop seamless. The motion only starts inside prefers-reduced-motion: no-preference, and because it runs longer than five seconds next to other content, a pause button sets animation-play-state through aria-pressed.

View code
.dv-tide__top {
  padding: 40px 24px 10px;
  background: #0c2a43;
  color: #cfe3f1;
}
.dv-tide__title {
  margin: 0 0 6px;
  color: #fff;
  font-family: inherit;
  font-size: clamp(22px, 3.6vw, 30px);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.dv-tide__top p {
  margin: 0 0 16px;
  font-size: 15px;
}
.dv-tide__pause {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px 0 14px;
  border: 1.5px solid #6fa8cf;
  border-radius: 999px;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.dv-tide__pause span {
  width: 10px;
  height: 12px;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
}
.dv-tide__pause[aria-pressed="true"] {
  background: #e8f3fa;
  color: #0c2a43;
}
.dv-tide__pause:focus-visible {
  outline: 3px solid #f2c14e;
  outline-offset: 2px;
}
.dv-tide__edge {
  position: relative;
  height: clamp(56px, 8vw, 90px);
  margin-top: -1px;
  overflow: hidden;
  background: #0c2a43;
}
.dv-tide__svg {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  width: 200%;
  height: 100%;
}
.dv-tide__svg--back path {
  fill: #1f6390;
}
.dv-tide__svg--front path {
  fill: #e8f3fa;
}
.dv-tide__bottom {
  margin-top: -1px;
  padding: 8px 24px 36px;
  background: #e8f3fa;
  color: #14324a;
}
.dv-tide__bottom p {
  max-width: 520px;
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
}
@keyframes dv-tide-drift {
  to {
    transform: translateX(-50%);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .dv-tide__pause {
    display: inline-flex;
  }
  .dv-tide__svg--front {
    animation: dv-tide-drift 10s linear infinite;
  }
  .dv-tide__svg--back {
    animation: dv-tide-drift 16s linear infinite reverse;
  }
  .dv-tide:has(.dv-tide__pause[aria-pressed="true"]) .dv-tide__svg {
    animation-play-state: paused;
  }
}

Mountain ridge into a dark footer

  • custom property fills
  • theme toggle
  • two SVG layers

Trail conditions this week

Upper switchbacks are dry. The river crossing at Kettle Ford is ankle deep after Tuesday rain.

Trail map Permits Ranger stations

Pinecrest Valley Trust

Resize the window: the shapes stretch with the section.

A light-to-dark transition is where a shape divider helps most, since the color jump is already a strong boundary. Both ridge layers and both sections read their colors from custom properties, so the theme switch only changes four tokens and the SVG follows, which a prefers-color-scheme rule inside an inline SVG would not do.

View code
.dv-ridge {
  --dv-page: #f4f1ea;
  --dv-ink: #22252d;
  --dv-far: #7d8aa3;
  --dv-foot: #1a1e27;
  color: var(--dv-ink);
}
.dv-ridge:has(.dv-ridge__theme[aria-pressed="true"]) {
  --dv-page: #12151c;
  --dv-ink: #e4e7ee;
  --dv-far: #2c3444;
  --dv-foot: #05070b;
}
.dv-ridge__page {
  padding: 40px 24px 12px;
  background: var(--dv-page);
  transition: background-color .4s ease, color .4s ease;
}
.dv-ridge__title {
  margin: 0 0 8px;
  color: var(--dv-ink);
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.2;
  transition: color .4s ease;
}
.dv-ridge__page p {
  max-width: 480px;
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.55;
}
.dv-ridge__theme {
  min-height: 44px;
  padding: 0 18px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  background: none;
  color: var(--dv-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.dv-ridge__theme[aria-pressed="true"] {
  background: #e4e7ee;
  color: #12151c;
}
.dv-ridge__theme:focus-visible {
  outline: 3px solid #e2894a;
  outline-offset: 2px;
}
.dv-ridge__edge {
  display: block;
  width: 100%;
  height: clamp(60px, 10vw, 120px);
  margin-top: -1px;
  background: var(--dv-page);
  transition: background-color .4s ease;
}
.dv-ridge__far {
  fill: var(--dv-far);
  transition: fill .4s ease;
}
.dv-ridge__near {
  fill: var(--dv-foot);
  transition: fill .4s ease;
}
.dv-ridge__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 22px;
  margin-top: -1px;
  padding: 10px 24px 30px;
  background: var(--dv-foot);
  color: #c9cfdb;
  transition: background-color .4s ease;
}
.dv-ridge__foot a {
  padding: 8px 0;
  color: #f1f3f8;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.dv-ridge__foot a:hover {
  text-decoration: underline;
}
.dv-ridge__foot a:focus-visible {
  outline: 2px solid #e2894a;
  outline-offset: 2px;
}
.dv-ridge__foot p {
  margin: 0 0 0 auto;
  color: #a9b1c2;
  font-size: 13px;
}

Angled, torn and stepped edges

Straight-edged section breaks built with clip-path polygons and hard-stop patterns, no image files. The next section slides up under the cut, so the shape always reveals the right color behind it.

Slanted photo hero

  • clip-path: polygon()
  • cqw units
  • negative margin overlap
Pine-covered sea cliffs and terraced hillsides above a calm sea at sunset

Ride the cliff coast

Six days, 410 km and four hill passes with Ridgeline Tours.

Day 1 Harbor town to the lighthouse, 62 km

Day 2 Terraced olive roads, 71 km

The hero is clipped with a four-point polygon whose bottom-right corner sits higher than the bottom-left. The slant depth uses cqw units, so the angle stays the same at any width, with a fixed-pixel polygon declared first as a fallback. The next section pulls up under the cut with a negative margin.

View code
.dv-slant {
  container-type: inline-size;
  background: #f6f3ee;
}
.dv-slant__hero {
  position: relative;
  z-index: 1;
  display: grid;
  align-items: end;
  min-height: 320px;
  padding: 40px 24px 72px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 56px), 0 100%);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9cqw), 0 100%);
}
.dv-slant__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dv-slant__hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 26, .25);
}
.dv-slant__copy {
  position: relative;
  max-width: 440px;
  padding: 18px 20px;
  border-radius: 12px;
  background: rgba(12, 20, 28, .78);
  color: #f3f1ec;
}
.dv-slant__title {
  margin: 0 0 8px;
  color: #fff;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.dv-slant__copy p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}
.dv-slant__next {
  display: grid;
  gap: 6px;
  margin-top: -40px;
  padding: 56px 24px 32px;
  color: #2b2925;
}
.dv-slant__next p {
  display: grid;
  grid-template-columns: 56px 1fr;
  margin: 0;
  font-size: 15px;
}
.dv-slant__next strong {
  color: #a1461f;
}

Triangle notch pointing to the next step

  • seven-point polygon
  • calc() in clip-path
  • fixed-size notch

Send money in three steps

No branch visit, no paper forms. Most transfers land the same day.

  1. Add a recipientName and account number.
  2. Lock the rateHeld for 24 hours.
  3. Pay by card or bankTrack it in the app.

A seven-point polygon cuts a straight bottom edge with a 28px arrow in the middle. The points use calc(100% - 28px) and calc(50% +/- 28px), so the notch keeps its size and angle no matter how wide or tall the section gets, unlike a percentage-only polygon.

View code
.dv-notch {
  background: #fff6f1;
  color: #2a1a14;
}
.dv-notch__top {
  position: relative;
  z-index: 1;
  padding: 40px 24px 64px;
  background: #c2412b;
  color: #fff;
  text-align: center;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 28px), calc(50% + 28px) calc(100% - 28px), 50% 100%, calc(50% - 28px) calc(100% - 28px), 0 calc(100% - 28px));
}
.dv-notch__title {
  margin: 0 0 8px;
  color: #fff;
  font-family: inherit;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.dv-notch__top p {
  max-width: 420px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.5;
}
.dv-notch__steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 14px;
  margin: -28px 0 0;
  padding: 52px 24px 34px;
  list-style: none;
  counter-reset: dv-step;
}
.dv-notch__steps li {
  padding: 16px;
  border: 1px solid #f1d3c6;
  border-radius: 12px;
  background: #fff;
  color: #5a463d;
  font-size: 14px;
  line-height: 1.45;
  counter-increment: dv-step;
}
.dv-notch__steps strong {
  display: block;
  margin-bottom: 2px;
  color: #2a1a14;
  font-size: 15px;
}
.dv-notch__steps strong::before {
  content: counter(dv-step) ". ";
  color: #c2412b;
}

Zigzag teeth from a conic pattern

  • conic-gradient hard stop
  • repeat-x tile
  • ::after strip

Train at any Forge gym

One membership, 38 locations, open from 5 am.

Flex29 per month, cancel anytime

Annual24 per month, two guest passes

A 14px strip hangs under the section, filled with a conic-gradient that paints a 90 degree wedge from the bottom center of each 28px tile and nothing else. The hard stop turns every tile into one downward tooth, and repeat-x lines them up into a zigzag in the section color.

View code
.dv-zig {
  background: #161616;
}
.dv-zig__top {
  position: relative;
  z-index: 1;
  padding: 40px 24px 26px;
  background: #c6f04d;
  color: #141414;
}
.dv-zig__top::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 14px;
  margin-top: -1px;
  background: conic-gradient(from -45deg at 50% 100%, #c6f04d 90deg, transparent 0) 0 0 / 28px 100% repeat-x;
}
.dv-zig__title {
  margin: 0 0 6px;
  color: #141414;
  font-family: inherit;
  font-size: clamp(26px, 4.6vw, 38px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.05;
  text-transform: uppercase;
}
.dv-zig__top p {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}
.dv-zig__plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 14px;
  padding: 44px 24px 32px;
}
.dv-zig__plans p {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid #333;
  border-radius: 10px;
  color: #bdbdbd;
  font-size: 14px;
}
.dv-zig__plans strong {
  display: block;
  color: #fff;
  font-size: 18px;
}

Stepped pixel edge

  • repeating-linear-gradient
  • hard stops
  • two offset rows

Moss Knight: early access

A tiny dungeon crawler from Lantern Bit. Out on 12 November.

Twelve hand-drawn floors, a shop run by a frog, and a soundtrack written on a real chiptune tracker.

Two 16px rows hang under the section, each a repeating-linear-gradient with hard stops that alternate color and transparent blocks. The rows use different repeat lengths, so the blocks thin out unevenly like a dissolving 8-bit sprite, and the block size is one number to change.

View code
.dv-pixel {
  --dv-px: #4b2bb3;
  background: #120d26;
}
.dv-pixel__top {
  position: relative;
  z-index: 1;
  padding: 40px 24px 24px;
  background: var(--dv-px);
  color: #e6defe;
}
.dv-pixel__top::before,
.dv-pixel__top::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 16px;
}
.dv-pixel__top::before {
  top: 100%;
  margin-top: -1px;
  background: repeating-linear-gradient(90deg, var(--dv-px) 0 48px, transparent 48px 64px);
}
.dv-pixel__top::after {
  top: calc(100% + 15px);
  background: repeating-linear-gradient(90deg, transparent 0 16px, var(--dv-px) 16px 32px, transparent 32px 80px);
}
.dv-pixel__title {
  margin: 0 0 8px;
  color: #fff;
  font-family: ui-monospace, Consolas, monospace;
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}
.dv-pixel__top p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}
.dv-pixel__next {
  padding: 56px 24px 32px;
  color: #c9c1e6;
}
.dv-pixel__next p {
  max-width: 520px;
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
}

Torn paper edge with a fiber layer

  • irregular polygon
  • nested clip-paths
  • calc() offsets

Field notes from the Highlands

Day four. Wind from the north, rain by noon, and a pair of eagles over the loch before breakfast.

Read the full journal, with sketches and the route map, in issue 18.

Two nested elements carry almost the same jagged polygon. The outer one is off-white and the inner kraft layer is cut a few pixels higher, so a thin pale fiber edge shows along the tear. The points mix percentages across with fixed pixel depths, which keeps the tear the same height on any section.

View code
.dv-torn {
  background: #2a2723;
}
.dv-torn__fiber {
  position: relative;
  z-index: 1;
  background: #fbf7ee;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), 96% calc(100% - 4px), 92% calc(100% - 12px), 89% calc(100% - 2px), 85% calc(100% - 10px), 80% calc(100% - 3px), 76% calc(100% - 16px), 72% calc(100% - 6px), 67% calc(100% - 11px), 63% 100%, 58% calc(100% - 9px), 54% calc(100% - 3px), 49% calc(100% - 14px), 45% calc(100% - 5px), 40% calc(100% - 12px), 36% calc(100% - 1px), 31% calc(100% - 10px), 27% calc(100% - 4px), 22% calc(100% - 15px), 18% calc(100% - 6px), 13% calc(100% - 11px), 9% calc(100% - 2px), 4% calc(100% - 9px), 0 calc(100% - 4px));
}
.dv-torn__paper {
  padding: 40px 24px 52px;
  background: #e6d5b5;
  color: #3a2c1a;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 19px), 96% calc(100% - 10px), 92% calc(100% - 17px), 89% calc(100% - 8px), 85% calc(100% - 16px), 80% calc(100% - 8px), 76% calc(100% - 21px), 72% calc(100% - 12px), 67% calc(100% - 16px), 63% calc(100% - 6px), 58% calc(100% - 14px), 54% calc(100% - 9px), 49% calc(100% - 20px), 45% calc(100% - 10px), 40% calc(100% - 18px), 36% calc(100% - 7px), 31% calc(100% - 15px), 27% calc(100% - 10px), 22% calc(100% - 21px), 18% calc(100% - 11px), 13% calc(100% - 17px), 9% calc(100% - 8px), 4% calc(100% - 14px), 0 calc(100% - 10px));
}
.dv-torn__title {
  margin: 0 0 10px;
  color: #3a2c1a;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 600;
  font-style: italic;
  letter-spacing: -.01em;
  line-height: 1.15;
}
.dv-torn__paper p {
  max-width: 500px;
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 17px;
  line-height: 1.5;
}
.dv-torn__next {
  margin-top: -16px;
  padding: 40px 24px 32px;
  color: #ddd4c4;
}
.dv-torn__next p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

Which Method Should You Use to Build a CSS Divider?

It depends on the job. A plain break between two blocks takes an hr or a border. Anything curved needs SVG, and a label in the middle calls for a pseudo-element. The table puts them side by side.

MethodBest forMain limitExtra markup
hr or borderPlain line between content blocksSolid or dashed styles, no fadeNone or one div
Pseudo-elementLines beside text or an iconNeeds a flex wrapperOne wrapper
GradientFading, striped, or scalloped linesAwkward for large curvesNone or one div
clip-pathDiagonals and trianglesClips borders and children tooNone
Inline SVGWaves and smooth curvesPath data is tedious to write by handOne svg element

Most pages only ever need the first row. A styled hr covers blog posts and docs, and settings screens usually get by with it too. The other methods pay for their extra markup on landing pages and section edges.

A divider also has to strengthen the visual hierarchy of the page, and sometimes plain spacing does that job better than a line.

Curves are the one case where a border cannot help at all. Those need SVG paths, which stay sharp at any container width.

How to Style an hr Element as a Divider

Wipe the default border first, then draw your own with border-top and set the width and margin around it.

The rendering section of the HTML Living Standard (WHATWG) gives the hr a 1px inset border and an auto inline margin, plus a gray color. MDN adds that the element is defined by meaning now, which is why purely visual lines belong to CSS borders.

  1. Remove the default inset border with border: none.
  2. Draw the line with border-top: 2px solid #ccc, which sets thickness, style, and color in one declaration.
  3. Set the length with width: 60% and center it with margin-inline: auto.
  4. Add vertical spacing with margin-block: 2rem.
  5. Soften the line with opacity: 0.6 if it competes with the text.

That margin does more work than the line itself. The white space around a divider is what makes it read as a break, so I settle on 1.5rem to 3rem before touching line weight.

Why color alone does not work

This one catches almost everyone the first time. Setting only a color on an hr changes the line, but the inset style still paints a shaded edge on all four sides, 1px each, so the rule stays 2px tall.

Declare border-style or border-top yourself and the shading goes away. The old color and noshade attributes work by switching the style to solid, which tells you what the real fix is.

Line styles beyond solid

Signicat’s Catnip design system renders a native hr and maps its style setting straight to border-style: solid, dashed, dotted, or double. Its size setting maps to 1px, 2px, and 4px of thickness.

Dashed works for secondary breaks, and dotted is about the lightest touch you can get. Double reads as a formal, print-style rule. For that one, copy MDN’s own hr example, which uses a 3px double border.

How to Make a Divider With Text or an Icon in the Middle

An hr cannot contain text, so build a labeled divider from a flex row with a line on each side of the label.

Set the wrapper to display flex with align-items center and a gap, then give ::before and ::after an empty content string, flex: 1, and a border-top. The two lines share whatever width the label leaves over.

Tabler’s divider component shows how far the pattern stretches. Its hr-text class centers the label by default, and hr-text-start and hr-text-end move it to either end (Tabler documentation).

For an icon, swap the text for a span that holds the icon and keep the same two lines.

The fieldset and legend alternative

A fieldset with only a top border and a centered legend draws the same look with no pseudo-elements. The HTML Standard skips painting the fieldset border behind the legend, so the line breaks around the label on its own.

The cost is meaning. A fieldset groups form controls and its legend names that group, so using the pair for decoration sends the wrong signal.

The flex row works inside any container and keeps both lines level at every width, and moving the label takes one alignment change. It does need a wrapper element and a class on every divider. The fieldset route is a single border with no generated content, and the browser handles label placement. Its downsides are the wrong semantics for decoration and a legend position tied to the fieldset border.

One accessibility catch applies to both. MDN notes that browsers treat everything inside a separator role as presentational, so a heading placed inside role=”separator” loses its heading semantics (MDN Web Docs).

Keep the label as plain text and leave the role off the labeled wrapper.

How to Create Gradient, Fading, and Patterned Dividers

A border can’t fade out at the ends. A gradient can, and it can also repeat in custom stripes or shift color along the length.

For the fade, give a thin element a background of linear-gradient from transparent to a color and back to transparent. Webstudio’s separator docs set it at 2px tall, 50% wide, with 32px of auto-centered margin.

Tuning color stops by eye gets tedious, so a CSS gradient generator speeds up the fade and stripe variants.

For custom dashes, repeating-linear-gradient sets dash and gap lengths exactly. A radial-gradient tiled across the width draws a scalloped edge, and border-image accepts a gradient as its source if you want a gradient border.

Double lines come from a different trick. Put a box-shadow with zero blur and a 4px vertical offset on a 1px element, and the shadow paints the second line, which a box shadow generator lets you preview before you commit.

border-image has a catch, though. MDN states that border-radius has no effect on a border image, so a rounded gradient border needs two stacked background-image layers instead.

Some browsers also skip the image when border-style is none or the border width is 0, which is why MDN advises declaring a fallback border-style. The property itself has been Baseline since July 2015.

How to Build Wave, Curve, and Diagonal Section Dividers

Inline SVG handles waves and curves. Diagonals and triangles come from clip-path with polygon().

SVG wave dividers

Place the SVG at the bottom edge of the section and give it a viewBox with no fixed width or height. Set it to width 100% and the shape stretches to fill any container.

Fill the path with the next section’s background color, ideally through a custom property such as var(–color-bg). A wave that belongs on a top edge just needs transform: rotate(180deg), and display: block on the svg removes the small gap inline elements leave below them.

Hand-writing cubic bezier path data is tedious, because changing the wave height means recalculating every control point. An SVG waves generator outputs a copyable viewBox path and skips that step.

clip-path diagonals and triangles

The clip-path property is Baseline widely available and has worked across browsers since January 2020 (MDN Web Docs), so a polygon() diagonal needs no fallback in current browsers.

A triangle edge is clip-path: polygon(50% 0, 100% 100%, 0 100%), the same shape MDN uses in its own example. Stick to percentages, because MDN’s shape() versus path() comparison shows a path() clip stays fixed in pixels while the element grows.

Watch what gets cut. The clip applies to the element’s border and text as well as its background, so any content near the cut edge disappears with it. Any value other than none also creates a stacking context, the same way opacity does, which can change z-index layering between neighboring sections.

Dragging points in a CSS clip-path generator is faster than guessing polygon coordinates, and you can paste the finished values straight into the stylesheet.

How to Add Vertical Dividers in Flex, Grid, and Column Layouts

An hr only draws horizontal lines, so a vertical divider is usually a border on one item. A thin stretched element or a column rule also works.

Prefer border-inline-start over border-left. Tailwind’s documentation notes that the logical property maps to the left or right edge based on text direction, so the line follows the layout in right-to-left languages.

Flexbox and grid

In a flex row, give every item after the first a border-inline-start plus matching padding, or drop a thin element between items.

A standalone line needs height to stretch into. Chi, the design system from Lumen, states that its vertical divider requires a parent container with a specified height.

A grid with one row can use border-inline-start on :not(:first-child). Wrapping rows are the problem, because that rule leaves a stray line at the start of every new row, so switch to gap-based rules.

Multi-column and list items

The column-rule property is Baseline widely available for multi-column layouts and has worked across browsers since March 2017 (MDN Web Docs).

MDN’s page also shows a flex list with gap: 12px and column-rule: 10px groove maroon, which belongs to the newer CSS Gaps module. The same page’s formal definition still says the property applies to multicol elements, so check the compatibility table before you use it on flex or grid (MDN, revised 5 October 2026). As of October 2026, only Chrome and Edge 149 and later support these gap rules.

Keep the rule narrower than the gap, as in that example, where the 12px gap leaves room for the 10px rule.

For navigation links and list items, a sibling selector such as li + li adds the line to every item except the first.

Tailwind and Bootstrap utilities

Both big CSS frameworks ship shortcuts for this job.

The utility-first Tailwind framework adds borders between children with divide-x and divide-y. Reversed order catches people out. When flex-row-reverse flips the items, add divide-x-reverse, or the border lands on the wrong side of each one (Tailwind documentation, v4.3).

Bootstrap goes the component route. Its .vr helper arrived in v5.1, measures 1px wide with a min-height of 1em, and stretches to the container height inside flex layouts (Bootstrap 5.3 documentation).

Should a CSS Divider Be Hidden From Screen Readers?

Hide it when the line is purely visual, and leave it exposed when it marks a real change of topic.

Published guidance disagrees, and the disagreement is about intent, not browser behavior.

SourcePosition on hrReasoning
MDN Web DocsImplicit separator role, with presentation or none permittedNative semantics stay unless overridden
Pennsylvania Keystone design systemAdd aria-hidden=”true”Treats the line as visual only
Wonderflow design systemAdd aria-hidden when the line is not content-relatedSame visual-only reading

Keep the hr and its default role when the line marks a real break. For a visual-only line, draw it with a border or pseudo-element and add no node at all. Labeled dividers need nothing special, since the label stays readable text and the lines are pseudo-elements.

ARIA offers two ways to silence a leftover hr. According to MDN, aria-hidden="true" removes an element and all its children from the accessibility tree without hiding anything visually, while role="presentation" or none strips the semantics and keeps the content exposed.

For a childless hr the two end the same way. They differ on a wrapper, which is where mistakes happen.

MDN warns that aria-hidden is inherited, so it should not sit on a focusable element or on an ancestor of one. A toolbar wrapper that holds a divider and buttons would hide the buttons too.

If CSS already hides the divider with display: none, visibility: hidden, or the hidden attribute, skip the attribute. MDN says the element is out of the accessibility tree in all of those cases.

How to Make Dividers Responsive and Theme-Aware

Keep the sizing in relative units and the color in currentColor or a custom property. Media queries only come in when orientation or visibility has to change.

Percentage and rem widths scale with the container, so a 60% centered line stays proportional on a phone and on a wide monitor.

Orientation is trickier. A vertical divider between flex items turns into a stray sliver once the row wraps. Swap it for a horizontal rule with media queries, or hide the vertical one below the breakpoint.

Writing the stacked, horizontal version first and adding the vertical rule from a breakpoint up is the mobile-first order. It keeps the small-screen CSS short.

On color, currentColor lets the line follow the text color, and MDN lists currentcolor as the default for column-rule.

A common pattern goes one step further and exposes the color and spacing as custom properties, such as --divider-color and --divider-spacing, so one edit restyles every divider.

The prefers-color-scheme media feature is Baseline widely available, has worked across browsers since January 2020, and reports light when the user has expressed no preference (MDN Web Docs). Override only the color token inside the dark query and every divider updates.

SVG dividers need one extra step. MDN says a prefers-color-scheme rule inside an SVG is meant for SVGs used as embedded files, through an img tag for example, rather than SVGs inlined in HTML, so inline waves should take their fill from a custom property.

Motion deserves a thought as well. MDN lists scaling and panning large objects as vestibular motion triggers, which covers animated waves that drift across the screen. The prefers-reduced-motion feature has been Baseline since January 2020, so stop or tone down the animation inside @media (prefers-reduced-motion: reduce).

When a CSS Divider Is the Wrong Choice

Skip the divider when spacing or the layout already separates the content, container edges included.

Volvo Cars’ design system documentation (@volvo-cars/css v3.1.0) lists the cases plainly, and the table pairs each one with a better move.

SituationWhy a line failsBetter move
More margin would separate the blocksThe line only adds noiseIncrease spacing
Inside a card, tile, or modalThe container already separatesLeave it out
Purely decorative accentA divider signals structure, not styleUse a heading style or background
Covering a layout or alignment bugThe line hides the faultFix the layout

The same documentation names where a divider does earn its place. Dense tables and settings panels, mostly, and groups of menu items where spacing alone does not show the boundary. Its example is a “Danger zone” block set apart from standard settings.

Layouts built on minimalist design principles lean on space and type for grouping, and add a line only when those fail.

Shape dividers need extra restraint. A wave or diagonal between every pair of sections looks like noise, not polish, so I’d use one at the hero edge and let plain spacing handle the rest.

The quickest test is to remove the line and look at the page. If the grouping is still clear, leave it out.

CSS Dividers FAQ

Does the hr element need a closing tag?

No. A void element takes a start tag and must not have an end tag, according to MDN Web Docs, and hr is one. Write <hr> or <hr />; both are valid.

Can an hr go inside a select menu or a list?

Yes to both. MDN shows an hr between options inside a select element. Inside a list, wrap it in an li with role=”presentation” so the markup stays valid.

Can you animate a divider?

Yes, with limits. MDN lists clip-path as animatable for basic shapes such as polygon(), but not for url() references. The column-rule-width property animates as a length, while border-image-source is discrete, so a gradient border flips instead of fading.

Should a divider be an image file or CSS?

CSS or inline SVG, in nearly every case. An image file adds a network request and cannot follow the page’s text color. A border can inherit currentColor, and so can an SVG fill.

Is an hr the same as a div with a border?

No. An hr carries an implicit separator role and the browser defaults for gray color, a 1px inset border and an auto inline margin (HTML Living Standard, 2026), since it is a thematic break. A div with a border has neither the meaning nor the defaults.

Building a Reusable Divider Class Set

A reusable set starts with one base rule and a token each for color, thickness and spacing. Each variant then overrides a single token instead of redefining the whole divider.

Build order matters, because each step depends on the one before it. Start with the hr reset using border-top, driven by the color token. Vertical, labeled and gradient variants come next on the same tokens, and shape dividers go last, with the fill read from the color token.

Tokens first means one prefers-color-scheme override recolors every divider at once, inline SVG waves included.

The trade-off is a longer stylesheet and one more naming layer to maintain. The base hr needs no motion rule or extra markup, while every shape divider adds both, so each one has to earn its place.