Shopify themes, liquid, logos, and UX
Hi,
I have a custom liquid section that displays a video on my landing page. I was wondering if it was possible to add a "call to action" button (to send people to my shop) that overlays the video? The code I have so far is:-
<style> video { display: block; margin: 0 auto; width: 97%; height: 50%; } @media screen and (max-width: 767px) { video { display: none; } } </style> <!-- Video section will be hidden on mobile devices --> <video autoplay loop playsinline muted> <source src="https://cdn.shopify.com/videos/c/o/v/dfc57cbdaa394a368dd633a60a1c9615.mp4"> </video>
Using Dawn Theme 11 and my URL is https://www.snowdoniahoney.com (no password)
Apologies for the basic question but just learning my way around Shopify.
Best regards
Alun
Solved! Go to the solution
This is an accepted solution.
Hi @Alun
You can use this code to do that. o
<style>
.video-cover { position: relative; }
.video-cover .cta-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
z-index: 999; }
video {
display: block;
margin: 0 auto;
width: 97%;
height: 50%;
}
@media screen and (max-width: 767px) {
video {
display: none;
}
}
</style>
<!-- Video section will be hidden on mobile devices -->
<div class="video-cover">
<!-- Call to action button -->
<a class="cta-btn button" href="Add your site URL here">Open website</a>
<video autoplay loop playsinline muted>
<source src="https://cdn.shopify.com/videos/c/o/v/dfc57cbdaa394a368dd633a60a1c9615.mp4">
</video>
</div>
Please add URL that you want to open in href element of button code
- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
This is an accepted solution.
Hi @Alun
You can use this code to do that. o
<style>
.video-cover { position: relative; }
.video-cover .cta-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
z-index: 999; }
video {
display: block;
margin: 0 auto;
width: 97%;
height: 50%;
}
@media screen and (max-width: 767px) {
video {
display: none;
}
}
</style>
<!-- Video section will be hidden on mobile devices -->
<div class="video-cover">
<!-- Call to action button -->
<a class="cta-btn button" href="Add your site URL here">Open website</a>
<video autoplay loop playsinline muted>
<source src="https://cdn.shopify.com/videos/c/o/v/dfc57cbdaa394a368dd633a60a1c9615.mp4">
</video>
</div>
Please add URL that you want to open in href element of button code
- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
That's amazing Dan! Thanks so much
Just a further thought - rather than moving to a different page, could the button move the viewer to different "coordinates"/section on the same page?
You can do that by adding Id of section that you want to move in href element
- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Sorry! I'm sure I'm being numb here but I've been trying to find out a way to this without success. I'm assuming that instead of sending the click of the button I created to the video file, it needs to reference the section that you want to jump to so it's at the top of the page?
multicolumn color-scheme-83ad98f1-5d87-469d-8257-b59fa0f1f3c6 gradient background-none
<div class="rich-text content-container color-scheme-83ad98f1-5d87-469d-8257-b59fa0f1f3c6 gradient rich-text--full-width content-container--full-width section-template--19592360198454__df329a39-baec-4186-82b2-b20f9fb17e73-padding">
<div class="rich-text__wrapper rich-text__wrapper--center page-width">
<div class="rich-text__blocks center"><h1 class="rich-text__heading rte inline-richtext h0 scroll-trigger animate--slide-in" data-cascade="" style="--animation-order: 0;">
<strong>Welsh Wildflower Honey & Welsh Heather Honey </strong>
</h1></div>
</div>
</div>
Do I use the "rich-text__wrapper" element and then change the button to reference that element??
Please add this to href element of button #shopify-section-template--19592360198454__df329a39-baec-4186-82b2-b20f9fb17e73
- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
That's amazing @Dan-From-Ryviu ! Thanks for your help - I hope you like coffee? 😉
I love it. Thank you and have a great day ahead.
- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
For my own learning, could I ask why you get the string "
#shopify-section-template--19592360198454__df329a39-baec-4186-82b2-b20f9fb17e73" from that goes into the button element?? How do you know what to leave out?
You can find section ID when view source of page
- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Great - thanks!
Very welcome
- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Hi! I would like to use this to add a CTA button to my home page video. I want it to link to a collection or landing page elsewhere on the site. How do I do that? I am also sorry if I'm being dumb here 😉
Please create a Custom Liquid section on your homepage in Sales channels > Online Store > Themes > Customize, replace Add your site URL here in the code with the page link you want the button to open.
- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Hi, I don't have the option to 'replace Add your site URL here in the code with the page link you want the button to open.' I only see the attached when I add a new section:
Go to your store admin > Sales channels > Online store > Themes > Customize > click + Add section > Custom Liquid, add above code which marked as solution, and add your link
- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
ok amazing, that worked 🙂
next question: how do I create a button? at the moment it's just text and it's not in keeping with our brand. So can it be made to look the same as our other CTA buttons? Pls see attached screen shots - if possible I'd love to have the white CTA button?
this worked but i want the video to fill the page how would i do that?
Thank you, it works better than anything I tried. Only, how can I make it work on mobile devices also?
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn 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, 2025