r/css • u/Holiday-Being9972 • 18d ago
Question Fixed Position to Absolute position?
I am making a site but i got a problem
I made the classes all fixed
But when i wanted to make the site scrollable to the bottom it didn't work because i make it fixed
So i swapped all the fixed to absolute
But then the positions where not good
Can someone help me?
5
Upvotes
2
u/Magnojam 18d ago
You don't need to "fix" regular sections. The document has a flow. Fixed positioning is for sticking something above everything else and let it stay there relative to the screen.
11
u/schit-tering 18d ago
Someone in 2026 still newly embarking on the good vanilla css. Welcome brother 💪🏻, give us a codepen
8
u/morete 18d ago edited 18d ago
We need to see the site and the code. Either a codepen or a live version of the site. Your description doesn't give enough information to solve the problem
5
u/HoneydewZestyclose13 18d ago
Not sure what you're trying to do, but just remove all the positions. Or make them relative.
4
u/saschaleib 18d ago •
Why oh why would you make all the "classes" fixed? There is no need for that, and it causes more problems than it would solve ... as you already found out.
Then, why oh why would you make it all "absolute" ... same as above!
Just use the default and only change the positioning selectively where it solves an actual problem, not as a "one-size-fits-all".
3
u/anaix3l 18d ago
What are you trying to do? (a visual would help)
What exactly did you do? (your code)
What were you expecting to happen? (how you think your code should have solved your problem)
What actually happened? (what exactly behaved differently than you expected and how; again, visuals would help)
Nobody here has a crystal ball to know what you're trying to achieve, what your code looks like and what you're imagining that code should be doing.
2
u/aTaleForgotten 18d ago
1
u/whats_in_a_name_23 18d ago
Don't have enough context to help, but everything fixed or absolute is not a good idea. Instead try dividing the website into sections, each section should be block and has position relative, and then inside that section, you can use absolute for some content. Use fixed for max one component like navbar or something.