I would use %
. It is easiest to calculate and is always relative to the screen for outer elements (where their container is <body>
) and relative to their container for inner elements. em is relative to the users default font size where 1em = 12 pt
. I do not think em would be a good choice for this. However, using em on your text sizes would be a good idea, if you want users to be able to read the content on mobile devices without zooming.
I don't know what vw is, but I found this site: http://snook.ca/archives/html_and_css/vm-vh-units. It also mentions vh units. It seems they are relative to the view port where 100vw
is the full width of the current viewport. I fail to see how this is different than 100%
.
On images and things I would consider using max-
or min-
widths or heights.