No problem, that’s why we are here – I’m not sure why it’s doing that – unless you are switching between the visual and text editors or putting this code in the visual editor, possibly.
You need to use the TEXT editor for adding HTML code. There you would add the HTML part (<span class-"firstword">Change</span>
) – obviously you’d change that to fit your text. Don’t switch between the editors before saving – it messes up the code – known issue ?? . (Yes, it’s annoying :). ) Update the page before switching to the other one.
This part
{
background-color: red;
}
goes in the CSS file BUT you really absolutely should not modify theme files – you are creating a big mess for yourself in doing so – all your changes will be lost when WP is updated and it’s also crucial to have a clean copy of the default theme for troubleshooting purposes.
So you need to first create a child theme or install a custom CSS plugin such as My Custom CSS.