div height

Discussion in 'CSS' started by Garret, Apr 22, 2010.

  1. #1
    hi. how can I make a div ( the parent ) to fit at the height of other div that it's inside the first one?

    i have this code for the css.

    #div_one {
    height: 100%;
    width: 100%;

    margin-top: 30px;
    margin-bottom: 30px;
    background-position: 50% 0px;
    background-repeat: repeat-y;
    background-image: url(image.jpg);

    overflow: hidden;
    }

    #div_02 {
    height: 430px;
    width: 950px;
    margin-left: auto;
    margin-right: auto;
    padding-right: 30px;
    padding-left: 30px;
    }

    I would like to know how can I make this div_01 to obey to the 430px height? I've tried auto in the height but that way doesn't works well the background.

    thanks
     
    Garret, Apr 22, 2010 IP
  2. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #2
    It doesn't? Works for me. Which browser are you seeing this in? We need to see the complete markup.
     
    drhowarddrfine, Apr 22, 2010 IP
  3. Garret

    Garret Greenhorn

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    hi. I check in safari and firefox. I've solved it by erasing the 100% height of the div one. I leave this field empty and it works. how about that :p

    thanks for the reply :)
     
    Garret, Apr 22, 2010 IP
  4. stoneRide

    stoneRide Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    add this to #div_01

    {
    height:auto;
    overflow:hidden;
    }
    and remove the height:100% from it
     
    stoneRide, May 6, 2010 IP