Shopify themes, liquid, logos, and UX
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi there,
I have a problem with my website, which I built using Dawn theme.
The image in the 'image with text' section at the bottom of the home page has changed in shape. It used to be square, and I would like it to be square as the image in the 'image with text' section in the 'about us' page. The original image is square.
Link and screenshot below.
Any idea of how to fix this?
Many thanks
Solved! Go to the solution
This is an accepted solution.
Hello @Andrecolap
You can add code by following these steps
1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file
3. Paste the below code before </body> on theme.liquid
<style>
@media screen and (max-width: 768px){
.image-with-text__media--small {
height: 29.2rem !important;
}
}
</style>
Was my reply helpful? Click Like to let me know!
Was your question answered? Mark it as an Accepted Solution.
This is an accepted solution.
Hello @Andrecolap
You can add code by following these steps
1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file
3. Paste the below code before </body> on theme.liquid
<style>
@media screen and (max-width: 768px){
.image-with-text__media--small {
height: 29.2rem !important;
}
}
</style>
Was my reply helpful? Click Like to let me know!
Was your question answered? Mark it as an Accepted Solution.
Thank you @niraj_patel
I used your code, adjusted the height to 35 rem, and the image is now again square on mobile.
It still is not square on desktop (see screenshot below), can you suggest any solution?
You can add code by following these steps
1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file
3. Paste the below code before </body> on theme.liquid
<style>
@media screen and (max-width: 767px) {
.image-with-text__media--small {
height: 338px !important;
}
}
@media screen and (min-width: 768px)
.image-with-text__media--small {
height: 31.4rem !important;
}
}
</style>
Was my reply helpful? Click Like to let me know!
Was your question answered? Mark it as an Accepted Solution.
Hi @niraj_patel,
this didn't work, I also tried to change something within your code, but that didn't help. Maybe it is because of some other changes I previously did on margins and paddings.
If you have another solution, please do let me know.
Thank you
Hi @Andrecolap
Check this one.
From your Shopify admin dashboard, click on "Online Store" and then "Themes".
Find the theme that you want to edit and click on "Actions" and then "Edit code".
In the "Assets" folder, click on "base.css, style.css or theme.css" file, depending on which file your theme uses to store its CSS styles. At the bottom of the file, add the following CSS code:
@media only screen and (max-width:749px){
.image-with-text__media--small {
height: 60vh;
width: 60vh;
margin:auto;
}
}
And Save.
Result:
Please don't forget to Like and Mark Solution to the post that helped you. Thanks!