/* To center the form title within a form module */.hs_cos_wrapper .form-title {text-align: center;}
/* To center the form submit button */.hs_submit {text-align: center;}
However, the form remains to be a little off center. The widget itself is centered - and it looks great when I preview the template. But once I add my own form, the form does not center within the widget - it's aligned to the left with some empty space on the right, so it looks out of line with the button and title (which are correctly centered). I can kind of fix it with some uneven padding, but this causes issues at smaller sizes - and doesn't seem like the correct answer.
Off-center fields:
This is the test page I'm working on centering the form. It's worth mentioning I am using a pre-existing template that I did not create.
I have managed to use inspect and to make a change that fixes the issue, but I have been unable to replicate this in my template - perhaps someone with more experience might be able to provide some advice?
I'll try to show the fix I found when inspecting:
If I click on the fields I can see there is some empty space to their right.
If I untick "max-width" 500px the form properly centers!
However, this line does not exist in my style sheet or anywhere that I can find in my template. I searched for 500 and there is nothing in the style sheet refering to 500px.
Properly centered form:
Anyone know how to resolve this? or perhaps some insight into why it might be happening?
Hi there! It looks centered when I took a look at the page now. Were you able to resolve the issue?
As for the "max-width: 500px;", it's handy to take a look at the upper right-hand corner (above your "untick" on the screenshot) where it shows the location of that CSS - clicking on its brings you to the relevant stylesheet. In this case it comes from in between those <style></style> tags that have been added to your header, which could have been added in the "Head" section on the page settings, template settings or general settings.
Unfortunately, no it's not resolved yet - with the horizontal spacers on each side of the form it was fairly in the center, but still off to the left a bit, so it may have looked centered on first glance? Unless there is some possibility that it's just displaying weird for me...
I have now reduced the horizontal spacers so its a 3 column spacer, 6 column form , and 3 spacer. That makes the issue more apparent - and especially from within the editor, as shown below, you can see how the form fields are still signigicantly to the left within the widget area.
In regards to the max width 500px in the <style> tags - I see that it shows me "where it is", but unfortunately I have no idea where that actually is. I've checked the page head html in the page editor settings, it's not in the template style sheet, or when I edit the header module (or any other modules) in the template.
Taking a bit of a further look when inspecting the form, this is the source of the 500px. If I change it to 600px in the inspector, the form properly centers.
.pika-single seems to be a date picker after googling it. Not sure if that is something Hubspot is using or something that the creator of the template would have included. Do you know where else I might be able to access something like that to make the edit?