I'm having trouble with a basic issue and can't seem to figure it out. I have created a <div>
for my header, inside of which there is another <div>
containing an image (logo) and a title (<h1>
).
The problem arises when there is an unwanted extra space above the body, as shown in this picture. Removing the <h1>
title solves the issue, but I believe it's related to the float: left;
property applied to the image. When no float property is used, the space disappears, however, removing the float causes the image and title to lose alignment, visible in this image. So, my question is, how can I keep the image on the left and the title on the right without using floating properties?
Any assistance would be greatly appreciated, thank you!
Edit: Thank you to everyone for your responses. I am currently studying HTML and CSS at school, and these nuances are not often covered by my teachers. Thanks again.