Pixeltender Posted November 7 Share Posted November 7 Hi, is it possible to assign different colors to the titles of the various offerings on this page? https://www.jaclynandthejemstones.com/events-test I want it to mirror the attached flyer, but I couldn't find any sort of unique identifiers when inspecting the page. Link to comment
Solution SaranyaDesigns Posted November 7 Solution Share Posted November 7 @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
Pixeltender Posted November 9 Author Share Posted November 9 @SaranyaDesigns In all my years I'd never learned about nth-of-type selectors. It worked perfectly (though I did have to add the !important property), thank you so much! https://www.jaclynandthejemstones.com/events-test SaranyaDesigns 1 Link to comment
SaranyaDesigns Posted November 10 Share Posted November 10 @Pixeltender yahoo, glad it worked 🙂 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment