You can generally use px and em interchangeably. 1em is equal to the font height of that element (usually 16px by default). Em will also scale a bit better on different screen resolutions, so it's usually better than px.
In case you're interested, here are some of the other handy units you can use in place of px:
% size relative to the size of the parent
vh (viewport height): size relative to browser window height
vw (viewport width): size relative to browser window width (eg 100vw would be the full width of the screen)
rem: this is almost identical to em, but some people find rem simpler. Em is relative to the font size of that element. Rem is relative to the font height of the html element (usually 16px by default). But the difference is mostly personal preference, use whatever you find easier.