Jump to content

Assign different font colors for various <h2> titles in single section

Go to solution Solved by SaranyaDesigns,

Recommended Posts

  • Solution

@Pixeltender yeah there doesn't seem to be unique selectors unfortunately, but you could probably use nth-of-type selectors to target each title in order of which they appear, like this...

section[data-section-id="654a793b56fdd568d0daa8a4"] .list-item:first-of-type h2 {
	color: pink; /*whatever color you want here */
}
section[data-section-id="654a793b56fdd568d0daa8a4"] .list-item:nth-of-type(2) h2 {
	color: purple; /*whatever color you want here */
}
section[data-section-id="654a793b56fdd568d0daa8a4"] .list-item:nth-of-type(3) h2 {
	color: blue; /*whatever color you want here */
}
section[data-section-id="654a793b56fdd568d0daa8a4"] .list-item:nth-of-type(4) h2 {
	color: orange; /*whatever color you want here */
}
section[data-section-id="654a793b56fdd568d0daa8a4"] .list-item:nth-of-type(5) h2 {
	color: red; /*whatever color you want here */
}

etc...

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • 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.