Forums

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

Home Forums CSS center of img is center of viewport

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

    i cant find something like this on the web, but it really doesnt sound that complicated.

    so what i m looking for:
    i want the center of an image (the actual horizontal and vertical center of the image) to be in center (again, h and v middle) of the viewport.
    i cant even grasp where the problem is.
    none of the background-properties does the trick.

    any suggestions?

    #196256
    Senff
    Participant

    Not entirely sure if this is what you mean, something like this perhaps?

    http://codepen.io/senff/pen/pvLrjE

    #196271
    Shikkediel
    Participant

    Don’t forget to also add a -webkit- rule for the transform to be recognised in Safari in case of the second example (I think)…

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