I exported a video using the YouTube settings and the video looks fine on the YouTube website. However, when I embed the video a thin black background appears on the left and right. Adding CSS code margin-left:4px and margin:right:4px got rid of the black space, but created a horizontal black border at the top which I could not get rid of using margin-top:4px!
My composition settings are HDTV 1080 29.97; Width 1920px Height 1080px; Aspect ratio locked; square pixels; Background color black (which I suppose I could simply change to match my website page color).
I used the YouTube preset in the Media Encoder to convert the composition to MP4. On my video player on my desktop there is a considerable amount of black space left and right.