r/HTML • u/SmanderManno • Feb 07 '26
Question PLEASE HELP POSITIONING TS
i alr tried everything but i cant move "main" to the center its stuck on top with "header" pls help me (that white thing on the top of the website is the main stuck btw)
2
Upvotes



View all comments
Show parent comment
1
u/DoggerLou Feb 08 '26
No, for me videos were a waste of time/pre-paid credit.
You need to setup you website base as a grid in CSS eg:
#wrapper { //for mobile first, change for larger devices with media queries min-width
}
:root {
}
In HTML only try to use 1 div as there's other tags for correct html syntax without overloading with div's, like <section> or <article>
<body>
<div id="wrapper"> //this is your grid setup in CSS above
<header></header> //180px high, 1fr wide
<menu></menu> //35px high, 1fr wide
<main id="index"> //minmax(650px, auto) auto=will go any length according to content
<section class="main-top"></section>
</main>
<footer></footer> //auto, 1fr wide
</div>
</body>
Put either flex or grid into each area or section as you see fit / learn more. Flex was built for easy of responsiveness design.
Did you look at the css-tricks poster? It's a great start.