Site logo

Archived topic

css code to add highlight to archive post titles

3 replies · Started by James on March 21, 2023

Viewing posts 1–4 of 4

Hi, I have added a half-height highlight to H1 headings, I want to do the same to archive content titles (which are h2) but I don't want to do all H2 headings. What CSS code do I use to specify archive content titles?

This is what I did for H1 headings:
h1 {
background: linear-gradient(180deg, rgba(255,255,255,0) 65%, #FFABB2 50%); display: inline;
}

Thanks,
James

Hi there,

titles on the archive page are given the entry-title class so:

h2.entry-title is the selector you need.

Great, that works perfectly. Thanks!

Glad to hear that!

This archived topic is closed to new replies.