2 replies [Last post]
Dayve's picture
Last seen: 8 years 2 weeks ago
Timezone: GMT+1
Joined: 2014-09-13
Posts: 1
Points: 2

Hi, I have been teaching myself Html and css for over 6 months now and even though I can proudly say that I do understand quite a bit of it, I must admit that having nobody to teach me face to face is what is stopping me fully understand Html & Css.
My question might make me look silly but for the life of me, I have no choice but to post it. LOL
Basically, I have a div at the top and a div at the bottom of the page. When I play around with the top div like add margins...etc the div at the bottom moves down the screen. I understand the box model and know that div elements are block elements. My question is how do I stop the div at the bottom from moving down when I edit the top div? Is it to do with the positioning of the div? The display element? ....


gary.turner's picture
Last seen: 1 year 30 weeks ago
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

Show us your markup and css

We can only guess if we can't see what you've done.



If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

gautamz07's picture
Last seen: 6 years 1 week ago
Timezone: GMT+5.5
Joined: 2014-04-24
Posts: 265
Points: 403

Position Relative to the rescue

@Dayve you would probably have to use Position:relative on the first div and than use the Top , right, left , bottom properties to move the first div around , without affecting the bottom div .

but still having a look at your code would help ! . Use JSfiddle and make a fiddle , if you don't know how to make a JS fiddle , go on youtube and have a look , ITS ONE OF THE BEST TOOLS A BEGINNER CAN PICK UP .

Cheers .