The above should work with userstyle.css. Have you shut down (File > Quit) and re-started Joplin since adding the above? Joplin has to be restarted for css changes to take effect.
The above css will not work with userchrome.css as the body text of the editor is not controlled by the element body
and is also different if you use the default ACE editor or the beta CodeMirror editor.
This post gives a method for finding the elements and classes you may want to modify.
Again, if you modify userchrome.css you have to restart Joplin for the changes to take effect.