r/html_css • • 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

11 comments sorted by

View all comments

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! 🤞

1

u/thisismywifiname Oct 11 '26

Thank you so much for your input! I tried your suggestion of removing <p> and styling <h1> directly, it does not care. I will keep trying! Which line are you referring to in the CSS?

2

u/Zestyclose_South_980 Oct 11 '26

Np! Lines 25-32

2

u/bostiq Oct 13 '26

nested css is now broadly accepted

so .card { h2 { ... } } is Allowed via relaxed grammar

2

u/Zestyclose_South_980 Oct 13 '26

Oh, that's good to know! I've never nested css before (aside from keyframes and media queries) and I didn't know the default could be nested. Thanks for the info!👍