- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hello,
I am working on a website and am relatively new to CSS, I am wondering if there is an alternative to margin-top when positioning divs.
Right now I have everything where I want it to be, but if I move a div at the top, the divs below it also jump down or up, since I used margin-top.
Any thoughts?
We’d need to see the site.
Are you adding the margin to a class or an ID?
If you have “everything where I want it to be”, why are you moving divs?
That’s WAAAAY too much code.
Please put a **reduced** case in Codepen.io
Or provide a link to a live site.
I can tell you now…this…
is a bad idea.
Your menu structure is also wrong
This
`
`
Now, where are the margins that need changing?
Whoa…those are some huge margins.
It makes me think your HTML structure is marginal. You really shouldn’t need to do that.
I think you need to look at alternative layout methods, specifically “floats”.