-
rachel33Asked on September 29, 2025 at 8:09 AM
I want to make the city, postal code and state fields on the same line in the address widget.
-
Mikhail JotForm SupportReplied on September 29, 2025 at 9:55 AM
Hi Rachel,
Thanks for reaching out to Jotform Support. Are you referring to this form? If so, you can easily make the Postal Code, State and City fields in one line by Injecting CSS Codes into your form. Let me walk you through it:
1. First, copy this code:
span.form-address-line.form-address-city-line.jsTest-address-lineField {
max-width: 30% !important;
position: relative;
}
span.form-address-line.form-address-state-line.jsTest-address-lineField {
max-width: 30% !important;
position: relative;
}
div > div > .form-address-zip-line {
max-width: 32% !important;
position: relative;
top: -90px;
left: 437px;
}
2. In Form Builder, click on the Paint Roller icon on the right side of the page to open Form Designer.
3. Now, in the Form Designer menu, click on the Styles tab, scroll down and paste the code into the Inject CSS Code box. That’s it. The code is automatically saved.
Give it a try and let us know how it goes.
-
rachel33Replied on September 29, 2025 at 10:13 PM
Hi Mikhail,
Thank you that worked! But there is now a big gap between the address and the next field. How can I reduce the gap?
-
Jessica JotForm SupportReplied on September 30, 2025 at 12:22 AM
Hi Rachel,
You can consider adding this code under the existing code above:
#id_44 {
margin-bottom: -10%;
}
Here is the completed code:
span.form-address-line.form-address-city-line.jsTest-address-lineField {
max-width: 30% !important;
position: relative;
}
span.form-address-line.form-address-state-line.jsTest-address-lineField {
max-width: 30% !important;
position: relative;
}
div > div > .form-address-zip-line {
max-width: 32% !important;
position: relative;
top: -90px;
left: 437px;
}
#id_44 {
margin-bottom: -10%;
}
Here is how it will look like once the code is added:
Let us know if you need more help.
-
seocourse90Replied on September 30, 2025 at 4:05 PM
If you want to place City, State, and Postal Code on the same line in your JotForm, you can easily do this by adding some custom CSS.
Here’s how you can set it up:
- Open your form in Form Builder.
- Click the Form Designer (paint roller icon) on the right panel.
- Go to the Styles tab.
- Scroll down and paste this CSS inside the Inject Custom CSS box:
span.form-address-line.form-address-city-line.jsTest-address-lineField {
max-width: 30% !important;
position: relative;
}
span.form-address-line.form-address-state-line.jsTest-address-lineField {
max-width: 30% !important;
position: relative;
}
div > div > .form-address-zip-line {
max-width: 32% !important;
position: relative;
top: -90px;
left: 437px;
}
/* Adjusts spacing below fields */
#id_44 {
margin-bottom: -10%;
}
- Save the form and preview it — now your City, State, and Postal Code fields will appear neatly on the same line.
- If you notice extra spacing or alignment issues, you can tweak the margin-bottom or left values according to your layout.
I’ve used this approach myself and it works well.
Also, if you’re handling online applications and renewals, you may want to check this helpful resource on .
-
seocourse90Replied on September 30, 2025 at 4:10 PM
I faced the same issue before where City, State, and Postal Code fields were showing on separate lines, and the form didn’t look neat. The fix is to add some custom CSS in JotForm.
Here’s the step-by-step:
- Open your form in Form Builder.
- Click the Form Designer (paint roller icon) on the right panel.
- Go to the Styles tab.
- Scroll down and paste this CSS into the Inject Custom CSS box:
span.form-address-line.form-address-city-line.jsTest-address-lineField {
max-width: 30% !important;
position: relative;
}
span.form-address-line.form-address-state-line.jsTest-address-lineField {
max-width: 30% !important;
position: relative;
}
div > div > .form-address-zip-line {
max-width: 32% !important;
position: relative;
top: -90px;
left: 437px;
}
/* Adjusts spacing below fields */
#id_44 {
margin-bottom: -10%;
}
- Save your changes and preview. Now City, State, and Postal Code will appear neatly on the same line.
- If alignment looks off, you can adjust the margin-bottom or left values.
I actually came across this solution while working on form layouts for ID and document processing systems. For example, in , having fields aligned properly makes the application form much easier for users to fill out.
This approach keeps forms cleaner and improves the user experience.
-
seocourse90Replied on September 30, 2025 at 4:14 PM
I faced the same issue before where City, State, and Postal Code fields were showing on separate lines, and the form didn’t look neat. The fix is to add some custom CSS in JotForm.
Here’s the step-by-step:
- Open your form in Form Builder.
- Click the Form Designer (paint roller icon) on the right panel.
- Go to the Styles tab.
- Scroll down and paste this CSS into the Inject Custom CSS box:
span.form-address-line.form-address-city-line.jsTest-address-lineField {
max-width: 30% !important;
position: relative;
}
span.form-address-line.form-address-state-line.jsTest-address-lineField {
max-width: 30% !important;
position: relative;
}
div > div > .form-address-zip-line {
max-width: 32% !important;
position: relative;
top: -90px;
left: 437px;
}
/* Adjusts spacing below fields */
#id_44 {
margin-bottom: -10%;
}
- Save your changes and preview. Now City, State, and Postal Code will appear neatly on the same line.
- If alignment looks off, you can adjust the margin-bottom or left values.
I actually used a similar layout in a project related to https://onlinepoliceclearanceph.ph/
— there too, aligning fields properly made the form much cleaner and more user-friendly.
This method helps your form look more professional and easier to fill.
Your Reply
Something Went Wrong
An error occurred while generating the AI response. Please try again!