Shopify themes, liquid, logos, and UX
Hello all,
I have made custom slider in my store, but the slider is not full width.. there is a space before and after the slider.
i have used the below HTML, CSS, Javascript to implement this.
Could anyone tell me how to change it to full width?
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {box-sizing: border-box;}
body {font-family: Verdana, sans-serif;}
.mySlides {display: none;}
img {vertical-align: middle;}
/* Slideshow container */
.slideshow-container {
max-width: 1000px;
position: relative;
margin: auto;
}
/* Caption text */
.text {
color: #f2f2f2;
font-size: 15px;
padding: 8px 12px;
position: absolute;
bottom: 8px;
width: 100%;
text-align: center;
}
/* Number text (1/3 etc) */
.numbertext {
color: #f2f2f2;
font-size: 12px;
padding: 8px 12px;
position: absolute;
top: 0;
}
/* The dots/bullets/indicators */
.dot {
height: 15px;
width: 15px;
margin: 0 2px;
background-color: #bbb;
border-radius: 50%;
display: inline-block;
transition: background-color 0.6s ease;
}
.active {
background-color: #717171;
}
/* Fading animation */
.fade {
animation-name: fade;
animation-duration: 1.5s;
}
@keyframes fade {
from {opacity: .4}
to {opacity: 1}
}
/* On smaller screens, decrease text size */
@media only screen and (max-width: 300px) {
.text {font-size: 11px}
}
</style>
</head>
<body>
<h2>Automatic Slideshow</h2>
<p>Change image every 2 seconds:</p>
<div class="slideshow-container">
<div class="mySlides fade">
<div class="numbertext">1 / 3</div>
<img src="img_nature_wide.jpg" style="width:100%">
<div class="text">Caption Text</div>
</div>
<div class="mySlides fade">
<div class="numbertext">2 / 3</div>
<img src="img_snow_wide.jpg" style="width:100%">
<div class="text">Caption Two</div>
</div>
<div class="mySlides fade">
<div class="numbertext">3 / 3</div>
<img src="img_mountains_wide.jpg" style="width:100%">
<div class="text">Caption Three</div>
</div>
</div>
<br>
<div style="text-align:center">
<span class="dot"></span>
<span class="dot"></span>
<span class="dot"></span>
</div>
<script>
let slideIndex = 0;
showSlides();
function showSlides() {
let i;
let slides = document.getElementsByClassName("mySlides");
let dots = document.getElementsByClassName("dot");
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slideIndex++;
if (slideIndex > slides.length) {slideIndex = 1}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" active", "");
}
slides[slideIndex-1].style.display = "block";
dots[slideIndex-1].className += " active";
setTimeout(showSlides, 2000); // Change image every 2 seconds
}
</script>
</body>
</html>
Solved! Go to the solution
This is an accepted solution.
yes, please add this code
1. Go to Online Store->Theme->Edit code
2. Asset->/theme.css ->paste below code at the bottom of the file.
#shopify-section-1650166123c5ad0a90 .page-width {padding: 0;max-width: 100%;}
This is an accepted solution.
thanks, yes please add this code also
.template-index .main-content {padding-top: 0;}
#shopify-section-1647076815b1ea6540 {padding-bottom: 0;margin-bottom: -120px;}
Hello @Ponmalar
Welcome to our page. My name is Damimond. I'm a shopify partner.
I'm so happy to help you on your website but I need more information such as your shopify store link.
Best regards
fashntees.in
pwd : FT
This is an accepted solution.
yes, please add this code
1. Go to Online Store->Theme->Edit code
2. Asset->/theme.css ->paste below code at the bottom of the file.
#shopify-section-1650166123c5ad0a90 .page-width {padding: 0;max-width: 100%;}
Thanks Ketan it worked.
Can you also help me to remove the extra spaces in between each content.
This is an accepted solution.
thanks, yes please add this code also
.template-index .main-content {padding-top: 0;}
#shopify-section-1647076815b1ea6540 {padding-bottom: 0;margin-bottom: -120px;}
Thanks KetanKumar for your help..
@KetanKumar - I am sorry to ask you more..
The slideshow which i am having is automated slide show - arrows are not working when it is automatic. i want user to see the previous and next slides eventhough it is automatic slideshow. will you be able to help? the code is my initial post.
no rush thanks for the update yes, please check your theme.js file may be allow this option
can you help me the code i have to change in javascript?
tis is the script that i have.
<script>
let slideIndex = 0;
showSlides();
function showSlides() {
let i;
let slides = document.getElementsByClassName("mySlides");
let dots = document.getElementsByClassName("dot");
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slideIndex++;
if (slideIndex > slides.length) {slideIndex = 1}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" active", "");
}
slides[slideIndex-1].style.display = "block";
dots[slideIndex-1].className += " active";
setTimeout(showSlides, 2000); // Change image every 2 seconds
}
</script>
thanks but i can't see funation
I am not sure what i missed, i used automatic slideshow from w3schools
thanks for your support
@KetanKumar - i have one issue, when i see in desktop there is no issue, but in mobile i have below overlap issue. Please let me know the modification that i have to do.
oh sorry for that issue if you are able to code please use this Slick Slider code easy to manage desktop and mobile its work as well
oh sorry for any issue can you please send store url so i will check and guide you
Hi @Ponmalar ,
Please share your store URL and if your store is password protected then please provide password too.
So that we can help you.
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