Inline colour change html for headers

Just to make life difficult, I have a client who wants individual words in an h2 header to be different colours.

Anyone recommend the best way to code this inline, and override the site-wide header settings? I need to use hex numbers rather than generic red, blue etc. Have done this with regular text but headers are more tricky for a non coder like myself. for the record, this project is using Source.

Try Span tags round the individual words

2 Likes

You could put spans around each word in the header, then either apply a class name or even inline css

<span class="word01">Word one</span> <span class="word02"> Word two</span>

CSS

.word01 { color: red; }
.word02 { color:  blue; }

Replace the red and blue with the hex values.

3 Likes

Thanks guys - much appreciated even thought the thought of multi-coloured text doesn’t fill me with great joy… :crazy_face:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.