Support » Fixing WordPress » Centre Image/Ad

  • Hi, I’m trying to centre an image/ad in an image widget using the MH Magazine theme.

    I have tried a number of things in the ‘Image CSS Class’ but I’m not experienced in CSS/HTML and nothing is working.

    Any advice would be appreciated.

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello scenicrim,

    If you target the wrapper around the ad image, either by id or a class, you should be able to add a text-align: center to the wrapper and center the image. Here is an example:

    #media_image-41 {
    text-align: center;
    }

    or, you could use one of the classes:

    mh-home-1 {
    text-align: center;
    }

    Choose the ID or class based on which you think is less likely to change if, for example, you change the ad with another.

    If you add this to the Additional CSS in the Customizer (Appearance > Customize > Additional CSS), I believe this will accomplish what you are looking for.

    Hope this helps,
    Scott

    Thread Starter scenicrim

    (@scenicrim)

    Wow, thank you Scott!

    That worked great for the top ad, there is one further down the page as well and I assume I have to change the code for #media_image-41 to change that one? Just have to work out where to get the ID from, if you can help I would appreciate it.

    #media_image-41 {
    text-align: center;
    }

    That is id media_image-43 so you could use:

    
    #media_image-43 {
        text-align: center;
    }

    To get the ID and classes of an element, you can right-click on it in the browser and choose “Inspect” (or something similar depending on the browser you use). Then you can look at the HTML nearby for the class and ID.

    Sincerely,
    Scott

    Thread Starter scenicrim

    (@scenicrim)

    Got it!

    Thank you so much, that’s great!

    Really appreciate the help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.