I added a form to my website but it’s the entire width of the page… wondering if there is a way to make it half the size?
Topic summary
A user needs to resize an embedded form on their Shopify website from full-width to half-width and center it on the page.
Initial Solution:
- Add CSS code to
base.csstargeting the specific form section class - Set
max-width: 50%with padding adjustments (40px top, 25px bottom)
Centering the Form:
- Apply
margin-left: autoandmargin-right: autoto the same CSS snippet - This centers the form horizontally on the page
Follow-up Issue:
The user successfully implemented the solution but encountered the same problem with a second form on a different page. They’re asking how to apply similar CSS styling to resize and center this new form, suggesting they need guidance on identifying and targeting the new form’s specific section class in their stylesheet.
Add the following code to the form :
max-width:50%;
I’ve tried adding it to the code but can’t get it to work. Any idea where I should apply it?
Thanks!
Add the following code to base.css:
.section-template--21629194273090__f6e24410-7478-4bf8-a53c-d030d105cdc6-padding {
padding-top: 40px;
padding-bottom: 52px;
max-width: 50%;
}
Perfect! Are we able to centre it on the page?
Yeah, to the same snipped add the following :
.section-template--21629194273090__f6e24410-7478-4bf8-a53c-d030d105cdc6-padding {
padding-top: 40px;
padding-bottom: 52px;
max-width: 50%;
margin-left: auto;
margin-right: auto;
}
Thanks for your help!
Hi, I added another form on a new page but having the same issue again. How would I re-size and centre to this one?
https://fleurelleflowerfarm.ca/pages/a-la-carte-wedding-form
Thanks!