• Hello,
    I’ve been trying to center photos inside their wrapper on my website ( https://almasy-photography.com ). As you can see, it’s not working, photos are aligned to the left side at the moment.

    I know about
    margin 0 auto;
    and about

    position: absolute;
    width: 500px
    left:50%;
    margin-left: -250px;

    However, these two methods are not working.

    It’s probably something I’m missing about the parent div or another detail. Please help me understand what it is, and how to center the photos.
    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • change the class .entry from max-width to just width so its a static width…

    so eg width: 940px;

    and then maybe make another class for those images

    .centerimg { margin: 0px auto; display: block; }

    something along those lines will make it work.

    actually i think you’ll find you can remove a lot of unneeded css as well if you use that…

    Thread Starter readme123456

    (@readme123456)

    Thanks for reply.
    Changing ‘max-width’ to ‘width’ with ‘margin: 0 auto’ and removing ‘left:’ and ‘bottom:’ properties didn’t change anything.
    I didn’t try making another container for the images, because the .entry div itself is only holding the image, and there is another wrapper around it.

    Please let me know what ideas you have about this.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to center a div inside parent?’ is closed to new replies.