• Hi there,
    I added the snippet to add brands to the product pages, and I cannot for the life of me figure how to have the alignment/margin automatically centered down the text.
    It is easier to show images of what I am trying to achieve, I have got as far as editing the margins in inspect element, however, making the changes permanent is a whole different board game.
    This is what I am looking to achieve: https://1drv.ms/u/s!AtfTU9oluVzWg98Z1AmyeCAmBYkxkw?e=OrLVyr

    I did this by setting one of the margins to 30px, though that value for the same effect would differ by brand.

    • This topic was modified 3 years, 10 months ago by ohmsoffers.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Nico

    (@nicolamustone)

    Automattic Happiness Engineer

    Hello,
    Because of the way the image is added, it would be impossible to center it vertically for all brands if they have a different description length.

    I see that you added inline style for the image for this brand. I recommend adding the margin in that inline style for each image, so that you can manually change the value singularly.

    Thread Starter ohmsoffers

    (@ohmsoffers)

    Hiya, I am a complete novice, would you be able to provide information/links on how to achieve this?

    Many thanks!

    Nico

    (@nicolamustone)

    Automattic Happiness Engineer

    Hello,
    How do you add the brand image and content? Is it from a panel in your Dashboard? If so, does it come from a plugin or the theme?

    In any of these 2 cases, I’d recommend contacting the theme/plugin author for further help.

    If it’s you manually adding images and content instead, you can use the style attribute on your image like it’s done on the example link you sent to add a margin-top that will center the image vertically.

    Thread Starter ohmsoffers

    (@ohmsoffers)

    Hiya, so I have the brand images sourced from the plugin, they are uploaded to the corresponding brands, and the brand image and description is added to pages using:

    add_action( ‘woocommerce_single_product_summary’, ‘wc_ninja_add_brand_to_product_page’, 19 );
    function wc_ninja_add_brand_to_product_page() {
    echo do_shortcode(‘[product_brand width=”74px” height=”74px” class=”alignleft” padding-top=”50px;]’);

    }

    Thread Starter ohmsoffers

    (@ohmsoffers)

    I should clarify further, I have that code added to a plugin called snippets.

    I have been experimenting to see if I can achieve what I want, essentially it’s something like this:
    .wc_ninja_add_brand_to_product_page .img {
    margin: 25px 15px 20px 0;
    }

    But however, I imagine it’s not working because I am doing a lot wrong there. I added that both to the snippet and additional CSS, however none of which worked

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Brands logo alignment’ is closed to new replies.