Log in

View Full Version : Need help getting divs to move according to another div (mobile issue)



mat420
09-18-2015, 02:06 AM
this is a mobile issue, its fine on desktop
so im trying to use formerly written code ( a template ) and get divs to move up and down depending on where the other divs before and after it are
my issue is that, even if i align it right (for example, using top:100px, etc), if content is added to a div, it will overlap the div below it
rather than push the div below it, down further.

ive tried a lot so far, but am not good with coding so am failing horribly. (zindex, adding a uh ":after" to the css class codes, etc)

i used a random code (and other codes/methods) to make my site mobile friendly
alot of it lines up pretty well, one after another, after another
but some of it overlaps and i have no idea why
how do i force it to stop overlapping?
why do some of my divs overlap in mobile and some are perfectly fine?

thanks so much

Beverleyh
09-18-2015, 05:40 AM
We can't troubleshoot something we can't see. Please provide a link that demonstrates the problem.

Thinking out loud, be aware that "top" and "margin-top" behave differently. "Top" will visually move the block-level element that it is applied to, but not *actually* move it, so will have no effect on surrounding elements (probably the cause of your overlap on the div below). "Margin-top" will move block-level elements within the document flow - it will push other elements out of the way - although vertical margins that are in contact with each other will collapse, only taking the effect of the greater of the 2 margins. More info here https://css-tricks.com/what-you-should-know-about-collapsing-margins/

If you need more help, please provide a link.

mat420
09-18-2015, 03:27 PM
sorry about that
top-margin started to help (instead of just top) but i can NOT get the utube and better business borough images to stop overlapping the main content
thank you!!!
http://aciddr0p.net/help/test/


We can't troubleshoot something we can't see. Please provide a link that demonstrates the problem.

Thinking out loud, be aware that "top" and "margin-top" behave differently. "Top" will visually move the block-level element that it is applied to, but not *actually* move it, so will have no effect on surrounding elements (probably the cause of your overlap on the div below). "Margin-top" will move block-level elements within the document flow - it will push other elements out of the way - although vertical margins that are in contact with each other will collapse, only taking the effect of the greater of the 2 margins. More info here https://css-tricks.com/what-you-should-know-about-collapsing-margins/

If you need more help, please provide a link.