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

How to remove excess space between buttons on Klaviyo embedded form

Solved

How to remove excess space between buttons on Klaviyo embedded form

NonaBats
Shopify Partner
2 0 0

I created a Klaviyo embedded form on a Shopify page, but there's a ton of white space between the buttons when the browser is maximized. When I adjust the browser, it sometimes corrects the spaces. How do I decrease this? or make sure the spaces on the form stays the same? I've already decreased padding in Klaviyo to as small as it can be but that did not work. I also tried the solution from this post https://community.shopify.com/c/shopify-design/how-to-remove-excess-white-space-between-buttons-on-k... but also did not work.

 

Screen Shot 2024-10-24 at 1.30.27 PM.png

 

Here's the link to the form: https://wzy5i91esrrtic4k-42467000474.shopifypreview.com/pages?preview_key=a25fed79a03597fcc1347d89c2...

Accepted Solution (1)

sahilsharma9515
Shopify Partner
1280 165 249

This is an accepted solution.

Hi @NonaBats Please add the below code:

 

<style>
@media screen and (min-width: 1000px) {
    .prose:not(.prose--tight) :where(:not(meta, span) + *) {
        margin-block-start: unset !important;
    }
}
</style>

 

Please follow the steps:

  1. Login in shopify admin.
  2. Click on the Online Store.
  3. Then click on the button next to Customize in live Theme.
  4. Click Edit Code.
  5. Search theme.liquid in the code in left hand side in your theme.
  6. Add the following code in the bottom of the file above </body> tag

Result:

sahilsharma9515_0-1729755420198.png

Hopefully it will help you. If yes then Please don't forget hit Like and Mark it as solution!

 

Best Regards

Sahil

- Your

 Coffee Tip 

can create magic in coding ❤️❤️

- Need a Shopify Developer? CHAT ON WHATSAPP or EMAIL ME !


- Hopefully the solution will help you. If yes then Please hit

 Like 

and

 Mark it as solution! ❤️


View solution in original post

Replies 4 (4)

rajweb
Shopify Partner
845 71 160

Hey @NonaBats ,

the white space issue could be due to the way your Klaviyo form and Shopify theme interact. Here are some steps to troubleshoot and potentially solve this issue:

Inspect the Form's CSS:

1. Open the browser’s developer tools (Right-click > Inspect or press  ctrl + shift + I on Windows ).

2. Look for the container or form fields to see if there are unnecessary margins or padding applied.

3. You can try temporarily adding the following CSS in your theme (or using the developer tools to test):

/* Remove extra padding/margin between form elements */
.klaviyo-form input,
.klaviyo-form button {
    margin: 5px 0; /* Adjust margin as needed */
    padding: 10px; /* Adjust for comfortable size */
}

.klaviyo-form {
    max-width: 100%; /* Prevent overflow issues */
}

.klaviyo-form button {
    display: block;
    width: 100%; /* Ensures consistent button size */
}

This CSS reduces the margin between the input fields and the button and ensures that the form elements align consistently across browsers and screen sizes.

 

Force Consistent Width and Alignment

You can wrap the form in a div with a specific width or grid layout to prevent resizing issues:

.klaviyo-form-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 400px; /* Set desired form width */
    margin: 0 auto;
}

Place the klaviyo-form-wrapper class around the form in your HTML.

 

Disable Shopify Theme Styles from Overriding the Form:

Sometimes, the theme’s global CSS can conflict with your form. Try scoping the styles specific to the form:

.klaviyo-form * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

This ensures the form elements are not affected by global theme CSS.

 

Add Media Queries for Responsive Design:

Since you mentioned the space corrects when resizing the browser, the issue may be related to the layout at certain screen widths. Add this CSS to fine-tune responsiveness:

@media (min-width: 768px) {
    .klaviyo-form {
        padding: 0 20px; /* Adjust padding for larger screens */
    }
}

 

Let me know if any of these solutions help, or if the issue persists, I can guide you through further troubleshooting.

 

If I was able to help you, please don't forget to Like and mark it as the Solution!

Best Regard,

Rajat Sharma

 

Rajat | Shopify Expert Developer
Need a reliable developer for your next Shopify project? Let's connect!
Email: rajat.shopify@gmail.com
Portfolio: rajatweb.dev
Your one-stop partner for Shopify development, SEO, and performance. Let’s grow your store together!

Dan-From-Ryviu
Shopify Partner
12073 2359 2539

Please add this code to Custom CSS in Online Store > Themes > Customize > Theme settings 

 

 (min-width: 1000px) {
    .prose:not(.prose--tight) :where(:not(meta, span) + *) {
        margin-block-start: 0 !important;
    }
}

Screenshot 2024-10-24 at 13.56.38.png

 

- Helpful? Like & Accept solution!
- 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.

sahilsharma9515
Shopify Partner
1280 165 249

This is an accepted solution.

Hi @NonaBats Please add the below code:

 

<style>
@media screen and (min-width: 1000px) {
    .prose:not(.prose--tight) :where(:not(meta, span) + *) {
        margin-block-start: unset !important;
    }
}
</style>

 

Please follow the steps:

  1. Login in shopify admin.
  2. Click on the Online Store.
  3. Then click on the button next to Customize in live Theme.
  4. Click Edit Code.
  5. Search theme.liquid in the code in left hand side in your theme.
  6. Add the following code in the bottom of the file above </body> tag

Result:

sahilsharma9515_0-1729755420198.png

Hopefully it will help you. If yes then Please don't forget hit Like and Mark it as solution!

 

Best Regards

Sahil

- Your

 Coffee Tip 

can create magic in coding ❤️❤️

- Need a Shopify Developer? CHAT ON WHATSAPP or EMAIL ME !


- Hopefully the solution will help you. If yes then Please hit

 Like 

and

 Mark it as solution! ❤️


NonaBats
Shopify Partner
2 0 0

Thank you so much, Sahil. This is an easy fix and it worked.