r/html_css • u/thisismywifiname • Oct 11 '26
Help Title Bar Troubles
Hi folks! I'm doing a school project, and have wracked my brain trying to figure out how to fix this horrendous gap in my header. I'd love for the text to be aligned closer to the top, but have no idea how to adjust it without wrecking the photos I've painstakingly put in place. Please see the second photo for the horrible gap. Please be kind, I'm still learning. Thank you!
4
Upvotes


2
u/thisismywifiname Oct 11 '26
Update: I kind of got it moved further north. I gave h1 and h4 it's own class on this page, then gave it relative positioning. I'm not 100% thrilled yet, but i'll keep trying.
2
u/Zestyclose_South_980 Oct 11 '26 edited Oct 11 '26
Try removing the p tag around the h1, then style the h1 directly and set it to be centered. That should hopefully reduce the gap. Also, your code for CSS doesn't have a closing bracket until after you started another tag. One needs to be finished before you can move on. Good luck! 🤞
2
u/testingaurora Oct 11 '26 edited Oct 13 '26
2
u/bostiq Oct 13 '26
First of all, why are you wrapping all header elements in
<p>? Bad practice,<p>is semantic for paragraph and then you put an image in it... good luck screen readers!change it with a
<div>if you need a certain control, and give it a sensible class name.Also
<p>comes with his own set of default browser styles you'd have to deal with, so taking them off it's a really good idea.Secondly, is there more code for
.TheTopand inner elements? we can't establish what's the problem without seeing the complete code.If you can't share a url, perhaps you can put the whole code in a codepen? or whatever sand box service you are familiar with?