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.
If it looks fine on YouTube, but something looks awry when you embed it, the issue is not with After Effects or the Adobe Media Encoder, but something to do with how it's embedded.
Thanks, changed width to 99.5% from 100% and that did the trick!