Divi + Forms: CSS Snippets for Better Mobile UX

In today’s highly mobile-first world, creating an excellent user experience on smartphones is no longer optional—it’s a necessity. For WordPress site owners and designers using the popular Divi theme, optimizing forms for mobile usage is critical. While Divi comes with a visual builder that makes form creation a breeze, fine-tuning their appearance and usability on mobile screens often requires some well-placed CSS.

This article dives into practical and effective CSS snippets to enhance the mobile user experience of forms created within Divi. From making fields responsive to improving spacing, we’ll walk through methods to make Divi forms more accessible and user-friendly on smaller devices.

Why Mobile UX for Forms Matters

Over 60% of website traffic comes from mobile devices. This means that contact forms, newsletter signups, quote request forms, and surveys must be effortlessly usable on smaller screens. Issues such as misaligned fields, tiny input boxes, and poor tap targets can quickly frustrate users and lead to higher bounce rates.

Out-of-the-box, Divi’s forms are responsive, but they often need refinements. Fortunately, a few custom CSS tweaks can go a long way in enhancing the experience.

Core CSS Principles for Better Mobile Forms

When improving form UX for mobile, consider the following principles:

  • Readability: Make sure that text is legible without zooming in.
  • Tap Targets: Buttons and fields should be large enough to interact with comfortably.
  • Whitespace: Give elements breathing room for easier comprehension.
  • Input Optimization: Use proper input types for easier text entry (handled in HTML but styled via CSS for size).

Now, let’s explore CSS snippets tailored for Divi forms to meet the above principles.

1. Make Input Fields Full Width on Mobile

Sometimes, Divi forms have inputs that float side-by-side, even on mobile. This defeats usability. To force full-width inputs, apply the following CSS:


@media only screen and (max-width: 768px) {
  .et_pb_contact_form .et_pb_contact_field {
    width: 100% !important;
    display: block !important;
  }
}

This ensures that each field stacks vertically, making them easier to see and use on narrow screens.

2. Adjust Padding and Margins for Better Spacing

Overcrowded fields can be overwhelming on mobile. Improve readability and navigation by increasing vertical spacing between elements.


@media only screen and (max-width: 768px) {
  .et_pb_contact_form .et_pb_contact_field {
    margin-bottom: 20px;
  }
}

This snippet adds breathing room between form inputs, improving the overall look and usability.

3. Resize Fonts for Mobile Readability

Default font sizes on desktop don’t always scale well on mobile. Adjust the size for inputs and labels on mobile like this:


@media only screen and (max-width: 768px) {
  .et_pb_contact_form label,
  .et_pb_contact_form .input,
  .et_pb_contact_form textarea {
    font-size: 16px;
  }
}

This eliminates the need for zooming and helps maintain consistency in the form presentation.

4. Improve Button Usability

Buttons should be easy to tap on mobile. Enlarge their size and add spacing with this snippet:


@media only screen and (max-width: 768px) {
  .et_pb_contact_form .et_pb_button {
    padding: 14px 30px;
    font-size: 18px;
  }
}

This ensures that the button is both visible and accessible with a thumb tap.

5. Prevent Unwanted Horizontal Scrolling

Misaligned padding or oversized elements might cause the form section to scroll horizontally. Prevent this with:


@media only screen and (max-width: 768px) {
  .et_pb_contact_form_container {
    overflow-x: hidden;
  }
}

This keeps your form neatly contained within the screen boundaries.

6. Add Soft Rounded Corners (Optional)

While not required, rounded corners can enhance the mobile aesthetic and comfort. Try:


@media only screen and (max-width: 768px) {
  .et_pb_contact_form .input,
  .et_pb_contact_form textarea {
    border-radius: 8px;
  }
}

Visual comfort contributes to smoother user experiences, and this comes down to subtle but effective design choices.

7. Improve Placeholder Contrast

Some Divi forms use placeholders with low contrast which are harder to read on dim screens. You can increase their visibility like so:


@media only screen and (max-width: 768px) {
  .et_pb_contact_form ::placeholder {
    color: #444;
    opacity: 1;
  }
}

This helps users see example input values clearly, reducing form submission errors.

Bonus Tips: Accessibility & Usability

  • Use label tags properly in the form builder so screen readers can associate inputs with labels.
  • Set appropriate input types like email, tel, and number in the Divi form builder when available.
  • Test on real devices or emulators regularly to catch minor but impactful layout bugs.

Combining CSS via Divi Theme Options

To apply the above snippets, open the Divi dashboard and navigate to:

  1. Divi > Theme Options
  2. Select the Custom CSS box at the bottom of the page
  3. Paste the appropriate CSS snippets

You can also use a child theme’s stylesheet or the Divi Builder page-specific CSS panel if you want finer control per page.

Future-Proofing Your Mobile Forms

Mobile standards evolve, and ensuring that your Divi forms remain optimized requires occasional updates. Keep your theme, plugins, and forms tested regularly. Use real data (like heatmaps and analytics) to understand how users interact with your forms and where they drop off. A combination of great design and well-thought CSS will ensure a seamless user experience.

Frequently Asked Questions

  • Can I use these CSS snippets with any Divi form plugin?
    These snippets are designed for the native Divi contact form module. For third-party form plugins styled with Divi (such as Gravity Forms or Contact Form 7), class names may differ.
  • What is the best way to test mobile UX improvements?
    Use Chrome DevTools’ mobile view or actual mobile devices. It’s also helpful to ask real users to interact with the form and gather feedback.
  • Do I need to use a child theme to add custom CSS?
    No, Divi allows CSS additions via the Theme Options panel. However, for bulk or sitewide changes, using a child theme is considered best practice.
  • How can I undo CSS changes if something breaks?
    Keep backups of your original code or use Divi’s built-in Revision History to roll back any problematic changes.
  • Will these changes slow down my website?
    CSS is lightweight and loads quickly. Properly written CSS like the snippets above won’t significantly impact performance.

Optimizing Divi forms for mobile is a small investment that can yield significant improvements in engagement and conversion. With a focus on mobile-first design and usability, you ensure that every visitor—no matter their device—has a smooth and intuitive experience interacting with your site.

You May Also Like