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
  • #196255

    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?


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


    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.