I'm sure my question is quite a newbie one, anyway I can't figure out what I'm doing wrong. Basically, I created a <div>
that I use as header, and inside of it another <div>
that contains an image (logo) and a title (using <h1>
).
The problem is that I get an unwanted extra space above the body
as you can see in this picture.
If I get rid of the <h1>
title then everything is fine. I think the problem is due the float: left;
property that I have assigned to the image, because if I assign no float property then the space disappears, but as you can see if I remove the float: left;
the image and the title are not "aligned" anymore. So, the question is, how can I make the image to stay on the left and the title on the right of the image, without using float properties?
Any help will be appreciated, thanks!
Edit: Thanks everybody for the answers, I'm studying HTML and CSS at school and things like this are rarely mentioned by my teachers. Thanks again