SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jul 2006
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question 100% height in nested DIV

    Hi guys,

    I'm trying to make a bordered box using individual div fragments. Everything looks good so far except I can't figure out how to make the .boxMid height expand to 100% of the container div height (see attachment). The boxMid class is currently set to 100% height, but it's pushing the bottom border down. What I really need is a height in percentage that is equal to the height of the container div - 20 pixels (to account for the top and bottom borders).

    Any ideas?

    Thanks,
    Tom
    Attached Files Attached Files

  2. #2
    SitePoint Member
    Join Date
    Jul 2006
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Found a solution!

    After playing around with it a little more I finally got it to work! The solution is to add this to the the boxMid class to account for the top and bottom borders, which are 10 pixels high each:

    Code:
      margin-bottom: -20px;
    I hope this will save some of you time (and hair) if you've ever wanted to do something similar.

    Tom


Bookmarks

Posting Permissions

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