I would recommend you create a child theme and put the code into there. A simpler, and quicker option would be to use This Plugin.
Either way, you are creating a style sheet that take dominance over your website. So adding the code here will allow the changes to take affect without any layout issues.
Let me know if you need any more help with the coding part afterwards
Cheers!
[sig moderated as per the Forum Rules]