Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Absolute/relative positioning div with child

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #250150
    lastshepherd
    Participant

    I’m using absolute positioning and i got this problem:

    I have:

    Div A {
        top: 0;
        right: 0;
        width: 370px;
        height: 100%;
        background-color: #fff;
        position: absolute;
        Div child A {
            position: relative;
            height: 60px;
        }
        Div child B {
            position: absolute;
            height: 100%;
            overflow -y: scroll ;
        }
    }
    

    The problem is that i want to scroll overflow of the Div child B but i cant because it’s calculate the Top and Right from top-right and in will fall out of the button of my page that i don’t want. i want the height to be calculated from what is left of the space in Div A.
    i can’t use percentage because it will look ugly in different screens.

    Any help or tip would be appropriated.

    #250151
    Shikkediel
    Participant

    From what I can tell…

    child_B {
    height: calc(100% - 60px);
    }
    
    #250207
    lastshepherd
    Participant

    All the thanks in the world to you.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.