dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: Space after div

  1. #1
    Join Date
    Sep 2010
    Posts
    3

    Space after div

    Hi all,

    I'm programming a lay-out with css. The lay-out contains a contentbox which has position: absolute. When I put lots of text into the contentbox, the box reaches the edge of the page. How can I add space at the bottom of the box so that there is a space between the bottom of the page and the contentbox? I tried margin-bottom: 40px but it didn't work for me.

    Please help!

  2. #2
    Join Date
    Feb 2010
    Posts
    184
    position: absolute elements are taken out of the flow. This means it is basically independent to other elements except for the parent with position: relative. That is if you use margin on an position: absolute element it is in relation to the parent.

    I think the only way to fix what you have described without Javascript is not to use position: absolute;

  3. #3
    Join Date
    Sep 2010
    Posts
    43
    Could you not have a relatively positioned div around the content, inside of the abolutely positioned element and add the margin to this?

  4. #4
    Join Date
    Sep 2010
    Posts
    3

    Thumbs up

    nice suggestions.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles