Forums

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

Home Forums CSS Blank Div Not Getting 100% height why ?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #34492

    please any body have a solution that i used blank div in give style=”height: 100%” but is not getting without adding any content. have any solution

    #88082
    Mottie
    Member

    There are two different ways, that I know of, to do this. As wolfcry911 said, you need to set the html/body height if you want to fill the visible page (demo).

    Method 1 – padding/margins must be zero or it goes beyond screen height

    html, body {
    height: 100%;
    padding: 0;
    margin: 0;
    }
    div {
    height: 100%;
    padding: 0;
    margin: 0;
    }

    Method 2 – padding allowed; adjust position (top, left, right, bottom) to add margin

    html, body {
    height: 100%;
    padding: 0;
    margin: 0;
    }
    div {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px;
    }
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.