By adding another element (the <h1>
) the indices you use in the selectors are now off by 1. You might have noticed that the heading colours in your second demo have shifted up by one position also.
You could just increase the indices on the original CSS to select the new positions
header p:nth-child(2) strong { color: #f3b200; }
header p:nth-child(3) strong { color: #d27b26; }
header p:nth-child(4) strong { color: #dc572e; }
but the better solution is to use a different CSS selector nth-of-type
pseudo-class which takes the actual element into consideration, as already shown in Mr. Alien's answer.