Forums

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

Home Forums CSS Solution to centering vertically

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #26992
    pokerjk
    Participant

    I have been looking how I can center my site vertically but to no success. I have got it to work fixing the position but then if the browser window is smaller than the content the user can not scroll so that is no good.

    Any suggestions?

    Site is temp up at http://jamieknop.com/testfolder/

    Thanks,
    Jamie

    #67327
    pokerjk
    Participant

    Ok so now I am using the method of tables because all else has failed and even this is not working…

    Code:

    My website

    http://jamieknop.com/testfolder/index.html

    Any advice?

    Cheers,
    Jamie

    #67325
    TheDoc
    Member

    You might be able to try something like this:

    https://css-tricks.com/what-is-vertical-align/

    Wrapping the whole site in a div and then adding the vertical align to it.

    #67329
    pokerjk
    Participant

    Attempted with v-align.

    Current method still failure :/

    Code:
    body {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    height: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    }
    #container {
    width: 900px;
    margin: 0 auto;
    position: absolute;
    top: 50%;
    display: table-cell;
    vertical-align: middle;
    }
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.