• Resolved kk_admin

    (@kk_admin)


    Dear All,

    Some time ago I was fighting with alignment of images/embed youtube in my widgets, now on PC looks fine, but on mobile they are not centered… thank you in advance for your help!

    klarakolonits.com

Viewing 7 replies - 1 through 7 (of 7 total)
  • Try adding this CSS to Appearance> Theme Options> Advanced Settings.

    img.aligncenter {
        float: none;
        margin-right: auto;
        margin-left: auto;
    }

    Let me know if this works for ou

    Thread Starter kk_admin

    (@kk_admin)

    replied in another topic as well, this basically remains the only one that did not work, so I just move the reply here and mark the other topic as resolved.
    I still have images perfectly centered on my laptop (or any other PC) and aligned to left on mobile, in preview and on actual mobile device as well (see screenshot from Samsung Galaxy). I’m sure this is some silly thing I messed up. This is the code for one of these widgets, maybe this helps, it has all aligncenters one may ask for…:

    <a href="https://klarakolonits.com/2016-2017/"><img class="aligncenter wp-image-3293" src="https://klarakolonits.com/wp-content/uploads/2016/07/2016-mozart-2-300x120.jpg" width="250" height="100" data-id="3081" /></a>
    <p style="text-align: center;"><a href="https://klarakolonits.com/2016-2017/"><strong>MOZART | CONCERT ARIAS</strong></a></p>
    <p style="text-align: center;"></p>
    <p style="text-align: center;"><a href=" https://klarakolonits.com/2016-2017#jazz"><img class="aligncenter wp-image-3291" src="https://klarakolonits.com/wp-content/uploads/2016/07/2016-jazz-2-300x120.jpg" width="250" height="100" data-id="3081" /></a></p>
    <p style="text-align: center;"><a href="https://klarakolonits.com/2016-2017#jazz"><strong>OPERA | JAZZ</strong></a></p>
    <p style="text-align: center;"><a href="https://klarakolonits.com/2016-2017#katlan"><img class="aligncenter wp-image-3292" src="https://klarakolonits.com/wp-content/uploads/2016/07/2016-cosi-1-300x120.jpg" width="250" height="100" data-id="3081" /></a></p>
    <p style="text-align: center;"><strong><a href="https://klarakolonits.com/2016-2017/">COSì FAN TUTTE | OperaLab</a></strong></p>
    <p style="text-align: center;"><a href=" https://klarakolonits.com/2016-2017#strauss"><img class="aligncenter wp-image-3290" src="https://klarakolonits.com/wp-content/uploads/2016/07/2016-strauss-2-300x120.jpg" width="250" height="100" data-id="3081" /></a></p>
    <p style="text-align: center;"><strong><a href="https://klarakolonits.com/2016-2017/">STRAUSS: VIER LETZTE LIEDER</a></strong></p>
    Thread Starter kk_admin

    (@kk_admin)

    now I set the striped background and I have a strong feeling that they are not centered on desktop neither…

    Did you try the CSS I gave you at the end of the other thread?

    It’s working for me in Chrome inspect:

    .textwidget .aligncenter {
        float: none;
        margin-right: auto;
        margin-left: auto;
    }
    Thread Starter kk_admin

    (@kk_admin)

    DONE! I probably had some orphan text in custom CSS so it didn’t catch. I cleaned it up a bit (is becoming massive) and now seems fine on all devices ??

    it worked with the first code you proposed but there had to be some interfering stuff.

    Great! If you have anymore questions, don’t hesitate to open a new support thread.

    Thread Starter kk_admin

    (@kk_admin)

    Thank you very very much! Surely I will have, but for today I’m done with experimenting. ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘widget images not centered on mobile’ is closed to new replies.