How to add Side-By-Side Images in Custom HTML Section of the Warehouse theme

The Warehouse them has a Custom HTML Section that lets you add custom HTML to the home page. I would like to use this to add a section of Side By Side Images of equal size with some space in between them. These images should maintain their proportions at all times and should stack up on top of each other in mobiles.

Can anyone please help me with this?

Thanks

1 Like

https://codepen.io/ninthony/pen/zYKgwPQ

1 Like

Hello Ninthony,

First of all, thank you so much for replying!

Using the Custom HTML section, I can easily add the HTML code. However, I’m not entirely sure where to post the CSS code. If you need me to add the HTML first to activate that section, I can certainly do that for you.

Also, if it’s not too much to ask, can we add a link to each image?

Much appreciated!

Regards

You can add the CSS directly in the custom HTML section at the top of the page. If you copy and paste this into there it should work. I added links to google for each image, so just change that to whatever you need.


  

    [
    
![German-Shepherd-Puppy-Fetch-500x500.jpg|500x500](upload://6eFBbSMckKGTwzv42jeH22Mcmnd.jpeg)

    ](https://www.google.com)
  

  
  [
    
![D8H_0766_9-500x500.jpg|500x500](upload://dbN9UFDfXD2l4Z01fhZILjDnw7F.jpeg)

    ](https://www.google.com)
  

5 Likes

It works! Thanks so much Ninthony. The only thing I’m trying to figure out is this margin/padding there is at the top of the container. It seems like the section has some margin as well as the container, which makes it excessive. Ideally, we would only have the section padding as it is standard amongst all other sections in the theme.

I don’t seem to locate any css code of margin or padding in what you provided, so I wouldn’t know how to go about removing that space.

If you could help me with this last thing it would be great. If not, no problem. Thanks so much for helping me out. I will be marking this as a solution.

Kind regards!

1 Like

I couldn’t tell you that exactly, it appears to be part of your theme’s code. It looks like you have the HTML inspector open, in the top right corner next to “Styles” open the “Computed” tab while you have the element you want to inspect selected. There’ll be a list of properties that are applied to that element. Look for margin, and click the dropdown arrow, then hover the value and another little arrow should pop up next to it. If you click that arrow, it’ll take you to where the property is set, and if you want to override it you’ll just have to copy the identifier for the element (class name, id, whatever is used to apply the style), and then overwrite that css with new css at the bottom of your style sheet.

1 Like

IT WORKED! Thank you Ninthony for taking the time to write all of this out. I had posted something about it earlier and I did not receive any replies, so thank you really.

Not a problem, glad it helped.

1 Like

i would like these two images to sit side by side on the laptop and mobile view .. how do i do that ? I also would like to add an link to them when its clicked.please help.

my site is https://agm-nd.myshopify.com

no password

I want to do an image of 2 images side by side and I don’t understand coding! Help? Thank you!

this worked perfectly…I made a new page, then saved it…when I went to the PAGES heading I went to the page i just made and then edited the HTML copy and pasted your code and it worked great. How can JPGs not be supported here?

Hi, thanks for the above. I have copied and it works in the custom liquid, but what bits do I change if I want to use a downloaded image? Many thanks