Shopify themes, liquid, logos, and UX
Hello
I am trying to create a side by side Image section with an overlay text and call to action button similar to the below.
I am using Dawn
Solved! Go to the solution
This is an accepted solution.
hi @Samer1 ,
I have made a section for you here is the code. and output
<style>
.container {
display: flex;
}
.column {
flex: 1;
margin: 10px;
position: relative;
overflow: hidden;
}
.image {
width: 100%;
height: auto;
transition: transform 0.3s ease;
}
.text {
position: absolute;
bottom: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.5);
color: white;
width: 100%;
padding: 10px;
transform: translateY(100%);
transition: transform 0.3s ease;
}
.text h2{
color:#FFF;
}
.column:hover .text {
transform: translateY(0);
}
.column:hover .image {
transform: scale(1.1);
}
.cta-button {
display: inline-block;
background-color: #007bff;
color: #ffffff;
padding: 10px 20px;
text-decoration: none;
border-radius: 5px;
transition: background-color 0.3s ease;
}
.cta-button:hover {
background-color: #0056b3;
}
</style>
<div class="container">
{% for block in section.blocks %}
<div class="column" style="width: {{ block.settings.width }}px;">
<img
class="image"
src="{{ block.settings.image | img_url: 'large' }}"
alt="{{ block.settings.image.alt }}"
width="{{ block.settings.width }}"
height="{{ block.settings.height }}"
>
<div class="text">
<h2>{{ block.settings.heading }}</h2>
<p>{{ block.settings.text }}</p>
<a href="{{ block.settings.button_link }}" class="cta-button">{{ block.settings.button_label }}</a>
</div>
</div>
{% endfor %}
</div>
{% schema %}
{
"name": "Hover Image",
"class": "section",
"disabled_on": {
"groups": ["header", "footer"]
},
"settings": [
],
"blocks": [
{
"type": "heading",
"name": "t:sections.image-with-text.blocks.heading.name",
"limit": 2,
"settings": [
{
"type": "image_picker",
"id": "image",
"label": "t:sections.image-with-text.settings.image.label"
},
{
"type": "select",
"id": "height",
"options": [
{
"value": "adapt",
"label": "t:sections.image-with-text.settings.height.options__1.label"
},
{
"value": "small",
"label": "t:sections.image-with-text.settings.height.options__2.label"
},
{
"value": "medium",
"label": "t:sections.image-with-text.settings.height.options__3.label"
},
{
"value": "large",
"label": "t:sections.image-with-text.settings.height.options__4.label"
}
],
"default": "adapt",
"label": "t:sections.image-with-text.settings.height.label"
} ,
{
"type": "inline_richtext",
"id": "heading",
"default": "Image with text",
"label": "t:sections.image-with-text.blocks.heading.settings.heading.label"
},
{
"type": "text",
"id": "button_label",
"default": "Button Label",
"label": "Button Label"
},
{
"type": "url",
"id": "button_link",
"label": "Button Link"
}
]
}
],
"presets": [
{
"name": "t:sections.image-with-text.presets.name",
"blocks": [
{
"type": "heading"
}
]
}
]
}
{% endschema %}
Hope this will help you.
Regards
Shopidevs
Syncora: Backup & Restore [Free] - Automated real-time store backup with one-click easy restore.
Slider Revolution - Create sliders, theme sections, banners, videos, pages, advanced animation, and social feeds.
Essential Grid Gallery - Create photo galleries, video galleries, portfolio galleries, product gallery, collection gallery, and more.
EasyDisplay: Product Showcase - Easily display collections, related products, discounts, recently viewed items, and best sellers.
Hi, you want to create new section or want to use exting section image with text
The it is easy to give a solution.
Thank you
Syncora: Backup & Restore [Free] - Automated real-time store backup with one-click easy restore.
Slider Revolution - Create sliders, theme sections, banners, videos, pages, advanced animation, and social feeds.
Essential Grid Gallery - Create photo galleries, video galleries, portfolio galleries, product gallery, collection gallery, and more.
EasyDisplay: Product Showcase - Easily display collections, related products, discounts, recently viewed items, and best sellers.
Whichever solution is easier
This is an accepted solution.
hi @Samer1 ,
I have made a section for you here is the code. and output
<style>
.container {
display: flex;
}
.column {
flex: 1;
margin: 10px;
position: relative;
overflow: hidden;
}
.image {
width: 100%;
height: auto;
transition: transform 0.3s ease;
}
.text {
position: absolute;
bottom: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.5);
color: white;
width: 100%;
padding: 10px;
transform: translateY(100%);
transition: transform 0.3s ease;
}
.text h2{
color:#FFF;
}
.column:hover .text {
transform: translateY(0);
}
.column:hover .image {
transform: scale(1.1);
}
.cta-button {
display: inline-block;
background-color: #007bff;
color: #ffffff;
padding: 10px 20px;
text-decoration: none;
border-radius: 5px;
transition: background-color 0.3s ease;
}
.cta-button:hover {
background-color: #0056b3;
}
</style>
<div class="container">
{% for block in section.blocks %}
<div class="column" style="width: {{ block.settings.width }}px;">
<img
class="image"
src="{{ block.settings.image | img_url: 'large' }}"
alt="{{ block.settings.image.alt }}"
width="{{ block.settings.width }}"
height="{{ block.settings.height }}"
>
<div class="text">
<h2>{{ block.settings.heading }}</h2>
<p>{{ block.settings.text }}</p>
<a href="{{ block.settings.button_link }}" class="cta-button">{{ block.settings.button_label }}</a>
</div>
</div>
{% endfor %}
</div>
{% schema %}
{
"name": "Hover Image",
"class": "section",
"disabled_on": {
"groups": ["header", "footer"]
},
"settings": [
],
"blocks": [
{
"type": "heading",
"name": "t:sections.image-with-text.blocks.heading.name",
"limit": 2,
"settings": [
{
"type": "image_picker",
"id": "image",
"label": "t:sections.image-with-text.settings.image.label"
},
{
"type": "select",
"id": "height",
"options": [
{
"value": "adapt",
"label": "t:sections.image-with-text.settings.height.options__1.label"
},
{
"value": "small",
"label": "t:sections.image-with-text.settings.height.options__2.label"
},
{
"value": "medium",
"label": "t:sections.image-with-text.settings.height.options__3.label"
},
{
"value": "large",
"label": "t:sections.image-with-text.settings.height.options__4.label"
}
],
"default": "adapt",
"label": "t:sections.image-with-text.settings.height.label"
} ,
{
"type": "inline_richtext",
"id": "heading",
"default": "Image with text",
"label": "t:sections.image-with-text.blocks.heading.settings.heading.label"
},
{
"type": "text",
"id": "button_label",
"default": "Button Label",
"label": "Button Label"
},
{
"type": "url",
"id": "button_link",
"label": "Button Link"
}
]
}
],
"presets": [
{
"name": "t:sections.image-with-text.presets.name",
"blocks": [
{
"type": "heading"
}
]
}
]
}
{% endschema %}
Hope this will help you.
Regards
Shopidevs
Syncora: Backup & Restore [Free] - Automated real-time store backup with one-click easy restore.
Slider Revolution - Create sliders, theme sections, banners, videos, pages, advanced animation, and social feeds.
Essential Grid Gallery - Create photo galleries, video galleries, portfolio galleries, product gallery, collection gallery, and more.
EasyDisplay: Product Showcase - Easily display collections, related products, discounts, recently viewed items, and best sellers.
Hi @Samer1,
You can use image banners to do this
Hope this can help you
Kind regards,
HDL-Shin
@HDL-Shin & @Arif_Shopidevs both solutions worked perfectly!!!
You guys are the best!
@HDL-Shin is there a way to hide only the second photo on mobile?
Hi @Samer1 , pls try code in your theme and check it in storefront
@media (max-width: 749px) {
.banner__media.media.banner__media-half:nth-child(2) {
display: none !important;
}
}
Hope this can help you,
If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you 😍😍
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025