Site logo

Archived topic

Partial Underline Headers

3 replies · Started by Gareth on April 25, 2021

Viewing posts 1–4 of 4

Hello :)

I wonder if there's a way to put a partial underline to each h1, h2, h3 and archive- post title?

I want a line roughly 3cm in length under each header.

Is there any code for this?

Thanks :)

Hi there,

try adding this CSS:

h1, h2, h3 {
  position: relative;
}
h1:after, h2:after, h3:after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100px;
  height: 2px;
  background-color: #000;
}

Perfect :)

Thanks for that!

You're welcome

This archived topic is closed to new replies.