Forums

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

Home Forums CSS overflow div at 100%

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #25143
    danielr0y
    Participant

    Hello all. Just a quick, but important question.

    When a child div’s width is set to be greater than its parent, the child div will extend (‘overflow’) out of the parent.

    Code:
    #parent{
    width: 10px;
    float: left;
    overflow: visible;
    }
    #child{
    width: 1000px;
    height: 100px;
    }

    My question is, How can I utilise this concept having the childs with at 100%?
    I obviously tried setting the childs with at 100% but no overflow occured.

    Thanks.
    Daniel Roy

    #59071
    apostrophe
    Participant

    Not really sure what you are trying to achieve. Would it not be simpler to just absolutely position #child?

    #59067
    danielr0y
    Participant

    I am reordering the divs for seo purposes, so yes absolute possitioning will work but i was still hoping to get a solution to this.
    I’ll explain further.
    divs are loaded ‘first’ first and ‘second’ second in html but are displayed ‘second’ first and ‘first’ second.

    Code:
    #first{
    width:100%;
    margin-top:300px
    float:right;
    #second{
    width: 0px;
    height:300px;
    float: left;
    overflow: visible;
    }
    #child{
    width: 100%;
    height: 100px;
    }

    #59080
    AshtonSanders
    Participant

    width: 100% does not mean 100% of the screen size, it means 100% of the available space (normally the parent width)

    #59055
    danielr0y
    Participant
    "AshtonSanders" wrote:
    width: 100% does not mean 100% of the screen size, it means 100% of the available space (normally the parent width)

    ah, so it does. Thanks. I’ll scrap this idea and stick with absolute.

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