• Heather

    (@hahawebdesign)


    My text center aligns perfectly. But my photos left align, even though they are set to center! I feel as though I have tried everything I can think of! Has anyone had this issue? I am using the twenty seventeen theme with the twenty seventeen child theme plug in. Please help me!!

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • i guess you defined this css rules

    .aligncenter {
        clear: both;
        display: block;
        margin-left: auto;
        margin-right: auto;
    
    }

    it is overwritten by other css rules. comign fro ai1ec.

    so if you add !important to margin parts, i guess it will do the trick. like:

    ` margin-left: auto!important;
    margin-right: auto!important;`

    Hello @hahawebdesign,

    You can just set your aligncenter display block to inline-block and it will automatically center you image. Then no need to set important in any of your code. But if you NOT set inline block to your class you may use auto margin and set it important what was said in the previous command.
    You can use below code.

    .aligncenter{
       clear:both;
       display:inline-block;
    } 

    or below code

    .aligncenter{
       clear:both;
       display:inline-block;
       margin:auto !important;
    }

    or you can use what was said in the previous code. Both of our code will work.

    Thanks

    • This reply was modified 7 years, 1 month ago by ThemesGrove.
    • This reply was modified 7 years, 1 month ago by ThemesGrove.
    use this css
    img.aligncenter {
        margin: 0 auto !important;
        display: table;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Center align issue with photos’ is closed to new replies.