For me there was a text before this
" <!DOCTYPE html>
like that it wasn't showing in the browser but it added whitespace since it wasn't in the html markup and couldn't be rendered or printed on the browser