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

Home Forums CSS Image not centering – how to fix ?

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #241561

    Hi Guys,

    On the following page , there are some images towards the bottom ( disco club scenes ).

    Can someone let me know why aren’t they aligning in the center ? Although they have been set to centrally alight via Magento’s WYSIWYG. And how to fix it without destroying the rest of the site ?

    Another page running on the same website has an image in the body which is aligning just fine …

    Thanks and best !


    Magento’s WYSIWYG is pretty terrible. I always tell clients to not use that, and just use the HTML code part for any CMS block.

    Anyway, the reason why the images don’t do that, can be found on line 438 of styles.css:

    img {
      display: block;

    Only images that are displayed inline will center when its parent has “text-align:center;”, so you’re going to have to override it one way or another.



    I see… humm


    Thanks indeed i removed “text-align:center;” from the parent and centered it at the element level ( img ) now is aligning and seems to have added those two :

    margin-left: auto;
    margin-right: auto;

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