Jump to content

How to underline headings?

Recommended Posts

I want to underline my h3/h4 titles but using either border-bottom, or ::after underline the whole heading block - not just the text.
Here is what I wanna achieve:
image.png.c001998156980a5e5cf72bafa5bb46b0.png
Anyone knows how to do this? 
Thanks!
 

Link to comment
  • Replies 4
  • Created
  • Last Reply

I found a workaround to achieve that:

1) I make the h4 a hyperlink (using "#" as url)

2) I create a code block in the page and add the following css:

h4 > a {
    text-decoration: none !important;
    padding-bottom: 4px;
    border-bottom: 4px solid #beb7ad;
    cursor: default;
    background-image: none !important;
}

It's not perfect but that do the job for now 🙂

EDIT: to remove the hover effect, add:
 

  h4 > a:hover { opacity: 1 !important; }

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.