All things Shopify and commerce
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
Can anyone help with a quick fix for this issue?
I need the custom liquid block to align with the rest of the page. Here's the code ChatGPT gave me:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Black Friday Secret Sale</title>
<style>
/* Container for centering the block */
.block-container {
display: flex;
justify-content: center; /* Center horizontally */
align-items: center; /* Center vertically */
width: 100%; /* Full-width block */
min-height: 400px; /* Adjust height to fit your design */
margin: 0 auto; /* Center within its parent container */
}
/* Center the image-container inside the block-container */
.image-container {
position: relative;
width: 100%;
max-width: 1200px; /* Adjust as needed */
text-align: center; /* Center the button */
}
/* Image styling for responsiveness */
.image-container img {
width: 100%;
height: auto;
display: block;
}
/* Button styling */
.image-container button {
position: absolute;
top: 50%; /* Center vertically over image */
left: 50%; /* Center horizontally over image */
transform: translate(-50%, -50%);
background-color: #d44100;
color: white;
border: none;
padding: 12px 30px;
font-size: 18px;
font-weight: 600;
cursor: pointer;
border-radius: 3px;
transition: background-color 0.3s ease;
}
/* Button hover effect */
.image-container button:hover {
background-color: #000000;
}
/* Adjust for smaller screens */
@media (max-width: 600px) {
.image-container button {
font-size: 14px; /* Reduce font size */
padding: 8px 20px; /* Adjust padding */
}
}
</style>
</head>
<body>
<!-- Centered Block -->
<div class="block-container">
<div class="image-container">
<img alt="Black Friday Secret Sale" src="https://cdn.shopify.com/s/files">
<button class="klaviyo_form_trigger">UNLOCK SECRET SALE HERE</button>
</div>
</div>
<script type="text/javascript">
document.querySelector('.klaviyo_form_trigger').addEventListener('click', function () {
window._klOnsite = window._klOnsite || [];
window._klOnsite.push(['openForm', 'form_id']);
});
</script>
</body>
</html>
Hey @LB2024
Welcome to Shopify Community! Can you share your Store URL so I can have a look on it? Also, if you have password enabled then please share the password as well. Your cooperation would be greatly appreciated.
Best Regards,
Moeed
Hi, there! the url is modernblaze.com
Hey @LB2024
I'm unable to locate this section on your website, can you tell me on which page is that?
Best Regards,
Moeed
the page was initially hidden because we were testing it. here you go: https://modernblaze.com/pages/test
The issue only becomes visible on desktop when it's zoomed out more than 90%
Is there something about CSS or is the issue in the actual custom liquid block?