I’m a beginner and am currently trying to sharpen my HTML and CSS skills by building a small mock-up of the GOOGLE home page. I’m having a bit of trouble making the header stay on top and not interact with my main tag. It took me a while to align the stuff on the navbar to the left and right side. But now that I’m trying to center my main tag, it automatically brings my header tag with it. Any advice? https://codepen.io/chrismorales/pen/YzzWgJJ
I want the <header> to stay on top while having my <main> be in the center of the page. Whenever I bring the <main> down to the center of the page, it brings the <header> along with it.
It looks like moving the <main> down with margin will carry the <header> down too. But padding will move <main> separately. I’m trying to understand why myself…